Instance Method

applicationDidEnterBackground

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

Declaration

- (void)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

Working with the watchOS App Life Cycle

Learn how the watchOS app life cycle operates and respond to life cycle notification methods.

- applicationDidFinishLaunching

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

- applicationDidBecomeActive

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

- applicationWillResignActive

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

- applicationWillEnterForeground

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

- deviceOrientationDidChange

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

- handleBackgroundTasks:

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