Contents

applicationDidEnterBackground()

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

Declaration

optional func applicationDidEnterBackground()

Mentioned in

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’s 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, don’t 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 aren’t notified when an app is purged from memory. The applicationDidEnterBackground() method is your last chance to perform any cleanup before the app terminates.

See Also

Monitoring state changes