Changes

An Overview of the watchOS 2 App Architecture

3 bytes added, 14:35, 10 May 2016
no edit summary
* '''awakeWithContext()''' - This method is called after the call to the init() method and may optionally be passed additional context data. This is typically used when navigating from one scene to another in a multi-scene app and allows data to be passed from the interface controller of the currently displayed scene to the interface controller of the destination scene. Access to user interface objects is available from within this method.
* '''willActivate()''' – Called immediately before the scene is presented to the user on the Apple Watch device. This is the recommended method for making final minor changes to the elements in the user interface. Access to user interface objects is available from within this method.
* '''didAppear() ''' – This method is called immediately after the scene associated with the interface controller becomes visible to the user on the Apple Watch screen. This is the recommended lifecycle method in which to initiate any animation sequences.
* '''willDisappear()''' – Called immediately before the scene associated with the interface controller is removed from view on the Apple Watch screen. This method should be used to stop any animation that is currently running.
* '''didDeactivate()''' – The last method called when the user exits the current scene or the system detects that, although the app is still running, the user is no longer interacting with the Apple Watch device. This method should be used to perform any cleanup tasks necessary to ensure a smooth return to the scene at a later time. Access to user interface objects is not available from within this method. Calls to this method may be triggered for testing purposes from within the WatchKit simulator environment by locking the simulator via the Hardware -> Lock menu option.