1

I am working on an app that is regularly performing web requests, I noticed that the requests were performed when I exited the app.

So I created an empty project to check if the issue came from me or not.

As you can see the willActivate() function is triggered when the app is executed:

enter image description here

However, I noticed that when I quit the app (pushing the digital crown), right after the didDeactivate() function is executed, willActivate() is called and immediately after that, didDeactivate() is executed again:

enter image description here

Apple documentation states that willActivate is called to let us know that the interface controller is active, but why ?

Lawris
  • 965
  • 2
  • 9
  • 21
  • I'm also experiencing illogical lifecycle steps. In my opinion there's bugs in watchOS. If you find the time, please alert Apple about this on the bugreport site. – Eric Aya Jul 17 '18 at 08:58
  • Ok so I searched a bit and tested the didAppear() function which is also messed up, it is triggered when the user quit the app but would normally be fired when the interface controller is showed up. – Lawris Jul 18 '18 at 08:20
  • Also, all the functions are working correctly when you manually lock the apple watch simulator (aka not pushing on the digital crown) so it's a bug for sure. – Lawris Jul 18 '18 at 08:21
  • I've also noticed willActivate is called whenever the watch app becomes active or moves into the foreground, but also when ver the watch app moves into the background. So if I launch the watch app for the first time, it runs willActivate once. If I press the crown to go back to my watch face, it runs willActivate again, and when I re-enter my app, it runs willActivate a third time. This is where my watch app is pulling new data from the web, so I only want to load data when I open my app, not when I close it. Is this normal? – Jackson Jan 22 '19 at 02:39

0 Answers0