<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIApplicationDelegate/applicationDidEnterBackground(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIApplicationDelegate(im)applicationDidEnterBackground:"
  },
  "title" : "applicationDidEnterBackground(_:)"
}
-->

# applicationDidEnterBackground(_:)

Tells the delegate that the app is now in the background.

```
optional func applicationDidEnterBackground(_ application: UIApplication)
```

## Parameters

`application`

Your singleton app object.

## Discussion

> Important:
> If you’re using scenes (see <doc://com.apple.uikit/documentation/UIKit/scenes>), UIKit will not call this method. Use ``doc://com.apple.uikit/documentation/UIKit/UISceneDelegate/sceneDidEnterBackground(_:)`` instead to perform any final tasks. UIKit posts a ``doc://com.apple.uikit/documentation/UIKit/UIApplication/didEnterBackgroundNotification`` regardless of whether your app uses scenes.

Use this method to release shared resources, invalidate timers, and store enough app state information to restore your app to its current state in case it’s terminated later. Disable updates to your app’s user interface, and avoid using some types of shared system resources (such as the user’s contacts database). Don’t use OpenGL ES in the background.

Return from [`applicationDidEnterBackground(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationDidEnterBackground(_:)) as quickly as possible. Your implementation of this method has approximately five seconds to perform any tasks and return. If the method doesn’t return before time runs out, your app is terminated and purged from memory.

If you need additional time to perform any final tasks, request additional execution time from the system by calling [`beginBackgroundTask(expirationHandler:)`](/documentation/UIKit/UIApplication/beginBackgroundTask(expirationHandler:)). Call [`beginBackgroundTask(expirationHandler:)`](/documentation/UIKit/UIApplication/beginBackgroundTask(expirationHandler:)) as early as possible. Because the system needs time to process your request, there’s a chance that the system might suspend your app before that task assertion is granted. For example, don’t call [`beginBackgroundTask(expirationHandler:)`](/documentation/UIKit/UIApplication/beginBackgroundTask(expirationHandler:)) at the very end of your [`applicationDidEnterBackground(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationDidEnterBackground(_:)) method and expect your app to continue running.

Perform any tasks related to adjusting your user interface before [`applicationDidEnterBackground(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationDidEnterBackground(_:)) exits. Move other tasks (such as saving state) to a concurrent dispatch queue or secondary thread as needed. Because it’s likely any background tasks you start in [`applicationDidEnterBackground(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationDidEnterBackground(_:)) won’t run until after that method exits, request additional background execution time before starting those tasks. In other words, first call [`beginBackgroundTask(expirationHandler:)`](/documentation/UIKit/UIApplication/beginBackgroundTask(expirationHandler:)) and *then* run the task on a dispatch queue or secondary thread.

UIKit also posts a [`didEnterBackgroundNotification`](/documentation/UIKit/UIApplication/didEnterBackgroundNotification) around the same time it calls this method to give interested objects a chance to respond to the transition.

For more information about how to transition gracefully to the background, and for information about how to start background tasks, see [App Programming Guide for iOS](https://developer.apple.com/library/archive/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007072).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)