Instance Method

applicationDidEnterBackground()

Tells the delegate that the app has transitioned from the foreground to the background.

Declaration

optional func applicationDidEnterBackground()

Discussion

Override this method to release shared resources, invalidate timers, and store enough app state information to restore your app to its current state if it is purged from memory. You have only a few seconds to complete these actions and return.

The system typically suspends your app shortly after this method returns; therefore, you should not call any asynchronous methods from your applicationDidEnterBackground() implementation. Asynchronous methods may not be able to complete before the app is suspended.

Additionally, the system may purge suspended apps at any time to make room for other apps. You are not notified when an app is purged from memory. The applicationDidEnterBackground() method is your last chance to perform any cleanup before the app is terminated.

See Also

Monitoring State Changes

func applicationDidFinishLaunching()

Tells the delegate that the launch process is almost done and the extension is almost ready to run.

func applicationDidBecomeActive()

Tells the delegate that the Watch app is now visible and processing events.

func applicationWillResignActive()

Tells the delegate that the Watch app is about to be deactivated.

func applicationWillEnterForeground()

Tells the delegate that the app is about to transition from the background to the foreground.

func deviceOrientationDidChange()

Tells the delegate that the device's orientation has changed.

func handle(Set<WKRefreshBackgroundTask>)

Tells the delegate that the app has received one or more background tasks.