Search code examples
iosproxyuilabeluiappearance

Setting the font using UIAppearence proxy sets everywhere


I want to ask a simple question related to setting some attribute using UIAppearence Proxy class in ios application. Lets say that i am setting the font of UILabel using UIAppearence Proxy class. Now does it sets the font of UILabel everywhere in the app for example if the UITableviewcell has a textLabel property. Does setting the Font or some other property through UIAppearence also results to set it every where that UIControl exists even inside some other control?


Solution

  • That's the general idea, yes.

    To set the properties for specific presentations, you should use the selector appearanceWhenContainedIn:, that lets you specify where UILabels will be modified.