1

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.

Katedral Pillon
  • 14,534
  • 25
  • 99
  • 199
  • Explain why you need to know this. Perhaps there's another way to accomplish your goal. – rdelmar Sep 21 '14 at 05:52
  • possible duplicate of [When do I need to call setNeedsDisplay in iOS?](http://stackoverflow.com/questions/10818319/when-do-i-need-to-call-setneedsdisplay-in-ios) – Marcelo Ribeiro Sep 21 '14 at 05:57

0 Answers0