---
title: applicationDidEnterBackground()
framework: watchkit
role: symbol
role_heading: Instance Method
path: watchkit/wkapplicationdelegate/applicationdidenterbackground()
---

# applicationDidEnterBackground()

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

## Declaration

```swift
optional func applicationDidEnterBackground()
```

## Discussion

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 system suspends the app. Additionally, the system may purge suspended apps at any time to make room for other apps. You aren’t notified when the system purges an app from memory. The applicationDidEnterBackground() method is your last chance to perform any cleanup before the app terminates. note: When creating an app that uses the SwiftUI App protocol to manage your life cycle, use the onChange(of:perform:) modifier and the scenePhase environment value to monitor life cycle changes when possible. For more information, see Building a watchOS app.

## See Also

### Monitoring state changes

- [Working with the watchOS app life cycle](watchkit/working-with-the-watchos-app-life-cycle.md)
- [main()](watchkit/wkapplicationdelegate/main().md)
- [applicationDidFinishLaunching()](watchkit/wkapplicationdelegate/applicationdidfinishlaunching().md)
- [applicationDidBecomeActive()](watchkit/wkapplicationdelegate/applicationdidbecomeactive().md)
- [applicationWillResignActive()](watchkit/wkapplicationdelegate/applicationwillresignactive().md)
- [applicationWillEnterForeground()](watchkit/wkapplicationdelegate/applicationwillenterforeground().md)
- [deviceOrientationDidChange()](watchkit/wkapplicationdelegate/deviceorientationdidchange().md)
