I just realized that the method willActivate
of WKInterfaceController
is already called for the next page (not only for the current page).
Is this a new "feature" or a bug? I could not find anything about it in Apple's WatchKit documentation.
How can I avoid initializing page 2 automatically when only page 1 is shown? (I tried to find a way to determine the currently shown page number or title but have not found a solution, yet. See this question.)
(I have updated my Apple Watch to version 1.01 and I use Xcode version 6.3.2.)
Watch OS 1.0.1 introduced a change that calls willActivate
and didDeactivate
in succession for the "next" controller in a page-based layout. Presumably, this is to give the next page a chance to update its interface before it's displayed.
Unfortunately, as you've noted, this makes it very difficult (if not impossible) to determine which interface controller has been viewed onscreen. These changes also conflict with the documented behavior of willActivate
and didDeactivate
, making it even more confusing.
You can read more about this change in Watch OS 1.0.1 Controller Life Cycle Changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With