I have a UIView
that is is @IBDesignable
@IBDesignable
class MyView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
sharedInit()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
sharedInit()
}
private func sharedInit(){
translatesAutoresizingMaskIntoConstraints = false
backgroundColor = .blue
}
}
When I place this a UIView
in the Storyboard, and assigned its class to MyView
in the Identity inspector, the UIView
still has a default background colour. Why is its background colour not UIColor.blue
in the Storyboard? And, how can I make it like this, please?
Thanks for any help.