I have a BaseView class which is inherited from UIView like:
@IBDesignable class BaseView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
}
I set this class for UILabel
, UIButton
and UITextField
in storyboard.
Now, I have to recognise that which one of the UILabel
, UIButton
or UITextField
is called the init?(coder aDecoder: NSCoder)
.
Is there anyway around this issue?
Update:
It seems that it's not possible to set custom class of type UIView to UILabel so there is no way around this issue.