Question

This may be a confusing title but basically; I would like to know at what point in UIView Lifecycle can I access the someFont property that I set via [MyView appearance] setSomeFont:...]

FWIW

I assign my appearance values inside AppDelegate application:didFinishLaunchingWithOptions:

and I read them in MyView drawRect:

If i was to read them at any other point i.e.: awakeFromNib (I am using nibs) the property is nil.

Which in some cases doesn't give me the best results i.e.: setting an attributed string in a table cell title (the text is set before the rect has drawn)

Was it helpful?

Solution

From the apple developer link UIAppearance

Note: iOS applies appearance changes when a view enters a window, it doesn’t change the appearance of a view that’s already in a window.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top