You can use dealloc (Objective-C) or deinit (Swift).
They are called when a controller is dismissed or popped.
Need to look into deinit but I still find it odd that didDeactivate() is called on context menu.
>still find it odd that didDeactivate() is called on context menu.
Your tvOS app loses focus at that point, so it's by design that dD() is called.
Its my WatchOS but still.
I'm trying to understand the definition
My controller should be perfectly active when I hit the context menu because my timer is running.
I would expect willDisappear to be called when you hit the context menu but not didDeactivate.
Also why isn't deinit called when you dismiss?
Called to let you know that the interface controller is no longer active.
Called to let you know that the interface controller’s content is now offscreen.
Can anyone confirm whether didDeactivate() gets called when you bring up the context menue on an actual Apple Watch
As per documentation, simulator behaves differently than device
In iOS Simulator, WatchKit calls this method for the current interface controller when you lock the simulator by selecting Hardware > Lock. When you subsequently unlock the simulator, WatchKit calls that interface controller’s
willActivatemethod again. You can use this capability to debug your activation and deactivation code.