Search code examples
iosswiftwatchkit

How do you add the stock apple watch loading screen?


In many apple watch apps during Apple's "Spring Forward" when the apps pushed to another interface controller, they looked like this:

enter image description here

Then the interface controller would load

I am perfectly aware that this screen appears when the app starts up, but I want to show the stock loading screen after I push an interface controller

**I do not want to use image sequencing to achieve this

Also apple has sample code you can download called "Lister" that shows the loading symbol after every interface controller push, without image sequencing

How can you achieve this??


Solution

  • TL;DR

    1. Either use the system behavior in the "Hides When Loading" checkbox under the Attributes of the Interface Controller and let the system manage it like in the example code or...

    2. Create your own interface controller that will have to use a image sequence.


    Longer Explanation

    Your confusing what's actually possible. The stock loading screen isn't something that you can actually call nor manipulate. It's the default loading animation for a controller that hasn't finished awakeWithContext:. That's why you see it in the example code.

    You can actually control it in the storyboard. Select or deselect the "Hides When Loading" checkbox under the Interface Controller section of the Attributes of the Interface Controller.

    enter image description here

    However, if you want control over when/where, you will have to create your own and yes that does mean you have to use an image sequence. There really isn't another way to do that animation currently without an image sequence.