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:
UI_APPEARANCE_SELECTOR
and conform to the UIAppearance protocols)?It looks like someone has filed a radar on this issue, but he mentioned having exceptions thrown when attempting to use methods through appearance proxy. They worked for me, and I agree that the references in the WWDC session makes it likely that someone just forgot to annotate the header.