How do I know, programmatically of course, when the effect calling setNeedsDisplay has taken place? There is no completion callback method that I am aware of.
Explanation
I need to add a two line label inside a self.navigationItem.titleView
. But each line needs to have different attributes. To know the size of the first line, I need to preload the UILabel in the titleView. And after the displaying is successful, then I can proceed. All of this needs to happen after ViewDidAppear, etc. So that I cannot use these lifecycle methods. So basically, after I set the unedited label to self.navigationItem.titleView
and call setNeedsDisplay, I need to know when I can go back to the titleView/UILabelView to know where the line break should occur so I can take advantage of the fully available width of the titleView. I hope this makes sense.