I’ve created a class that inherits from UIButton. If I add rounded-rect buttons to my XIB and set their class property to UIButton, they appear as rounded-rect buttons (but then none of my custom code is ever called, so the buttons behave like ordinary buttons which isn’t what I want). If I set these buttons’ class property in IB to my custom class UIButtonCustom, they still appear to be rounded rect buttons in the IB designer, but when I run the app the buttons are of the custom type (meaning they appear mostly blank with the button text, since I’m not setting any background image for the button).
Is there any way to get these buttons to look like rounded rect buttons when the app actually runs?
The rounded button that you see on xib is sub class of
UIButtoni.e.UIRoundedRectButton.And I don’t think you can subclass it as it’s not documented (a private API).