How to change title of an interface element before it is shown?

Add a label to your screen and type ABCD as the title in storyboard.

OR

Type ABCD in the title field of InterfaceController in storyboard.


Now, set the label's title to "abcd" OR InterfaceController's title to "abcd" in code.


Launch the app and you will see the text as "ABCD" right before it becomes "abcd".


I couldn't find a way to change the text before anything is shown on the screen.

If I delete the text in interface builder, it may be a hack as the previous text will be empty.. but it becomes harder to maintain it, understand it later I open it. This is not limited to labels, but also buttons, etc.. So every UI element shows something else before I set it to another thing..


Am I doing something wrong or isn't this possible? (as there is no willAppear method)

From Interface Builder, enable the "Display Activity Indicator When Loading" option for the interface controller. Then, any UI updates performed before willActivate() completes will happen before the UI is shown.

Thank you very much for your reply.


It is already checked and it doesn't work.

Seems to work fine in Xcode Version 7.1 beta (7B60) in the simulator as a watchOS 2 app with "[self.testLabel setText:@"abcd"];" in willActivate.

Simulator is fast, I tested in directly on the watch and the change of the text is noticable.

Yes, label's text updating is very slow on real device.

How to change title of an interface element before it is shown?
 
 
Q