I'm maybe too complicated, but here is what I want:
@IBDesignable
class A: UIView {
@IBInspectable var title: String = "" {
didSet {
setNeedsLayout()
}
}
}
@IBDesignable
class B: UIView {
var firstView: A = A()
var secondView: A = A()
}
The B class have 2 @IBDesignable classes, so if I want to customize B directly in Interface Builder, I can't as I don't have access to the 2 A classes.
At first I create a protocol to list all elements in A class, but when a view need 2 or more item of A class, I can't use this.
Do someone have an idea to have only 1 B class in my storyboard and can customize both A classes?