Search code examples
watchkitwatchos-2

WatchKit: setTitle delay?


When I push a new controller in WatchKit and use setTitle in the new controllers' awakeWithContext: method it takes a second or so to set the title, it stays blank until then. When I set the title in the storyboard it appears instantly.

Am I missing something or is this expected behavior?


Solution

  • That's correct. If you set the title in the Storyboard, the Watch reads the value directly from the resources which are saved on the device.

    If you set it in code, the Watch will need to run a request to your Extension (which runs on your iPhone) and then it'll receive the value back and display it.

    If the title of the controller is static, you should directly add it to your storyboard.