문제

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)

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top