Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When do UIAppearance proxy rules get applied to new view controller?

I'm wandering when exactly do UIAppearance rules get applied to some new view controller?

I've made some global rules and I call them in my app delegate. That way all UIButtons look that same. But now I want to modify just appearance of one UIButton. I've tried putting the code to remove it's background inside - (void)viewDidLoad but it's not working - UIAppearance rules aren't applied yet. In one ViewController I put modification code inside - (void)viewWillLayoutSubviews and it worked perfectly, but now in another ViewController it doesn't work (code is the same).

Where is it safe to override UIAppearance rules?

like image 450
xx77aBs Avatar asked Jul 13 '12 13:07

xx77aBs


1 Answers

According to the 2011 WWDC video introducing UIAppearance, the customizations are applied right before -layoutSubviews is called on the view.

like image 74
BJ Homer Avatar answered Oct 19 '22 21:10

BJ Homer