I have a project in which I put a UIButton on a screen and changed its custom class to PKAddPassButton
using XCode (Interface builder)
The documentation of this class said that
NS_CLASS_AVAILABLE_IOS(9_0) @interface PKAddPassButton : UIButton
which means that it's available on iOS 9 upward. But the app crashes every time I ran it on iOS 9 (real devices and simulators) with error message
This coder requires that replaced objects be returned from initWithCoder:
When I ran it on iOS 10, it works fine, the button showed up.
Did anyone experience the same thing and found a solution?
Update: The button works fine if it is created programmatically in the code
You need to instantiate it programmatically instead. That's what I did and it worked for me.