Instance Method

didDeactivate()

Called to let you know that the interface controller is no longer active.

Declaration

func didDeactivate()

Discussion

The system calls this method as part of the cleanup process for the interface controller. Use this method to invalidate timers or save any app-related state information that has not already been saved. Any tasks you perform using this method should finish quickly. An inactive interface controller may be reactivated later or it may be deallocated.

Do not use this method to modify your interface. WatchKit ignores attempts to set values of interface objects while your interface is inactive, including during the execution of this method. Modifications can be made only during initialization of your interface controller and between calls to willActivate() and this method.

The system calls this method on your WatchKit extension’s main thread. The super implementation of this method does nothing.

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 willActivate() method again. You can use this capability to debug your activation and deactivation code.

See Also

Responding to Activation and Appearance Events

func willActivate()

Called to let you know that the interface controller’s is active.

func didAppear()

Called to let you know that the interface controller’s content is now onscreen.

func willDisappear()

Called to let you know that the interface controller’s content is now offscreen.