According to the UIAppearance protocol reference a class need to conform to the UIAppearanceContainer and have supported methods marked with UI_APPEARANCE_SELECTOR
in order for the appearance proxy to work properly. In Apples own instruction video from WWDC 2011, "Customizing the appearance of UIControls", they provide examples where they use, and discuss, both UIButton and UILabel.
Both of these classes conform (via inheritance from UIView) to the UIAppearance and UIAppaeranceContainer Protocols, but none of them have methods marked with UI_APPEARANCE_SELECTOR
. The do work though, but my cents are spent on them not being fully supported by Apple, why it would be unsafe to use the appearance proxy on them.
So I have a few questions:
- Have I missed something that makes UIButton/UILabel conform to the UIAppearance proxy prerequisites?
- Would you argue that they are unsafe to use with the UIAppearance proxy?
- On what object would you use the appearance proxy in production, if it turns out that these two classes don't conform (the obvious answer being, of course, any object that mark their methods with
UI_APPEARANCE_SELECTOR
and conform to the UIAppearance protocols)?