I have a custom button designed using xib file like this:
and I connect it to my storyboard like this:
but when I run the app, I got runtime error complaining that IBOutlet ivRightIcon is nil
@IBInspectable var rightIcon: UIImage? = nil{
didSet{
ivRightIcon.image = rightIcon
}
}
}
My outlet is connected in xib file correctly I'm using Swift 3 and xCode 8.2.1 Please help!
I managed to solve this. I should set the View class as UIButton and File's Owner as my custom button class