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

# applicationWillEnterForeground(_:)

Tells the delegate that the app is about to enter the foreground.

```
optional func applicationWillEnterForeground(_ 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/sceneWillEnterForeground(_:)`` instead to prepare your app to enter the foreground. UIKit posts a ``doc://com.apple.uikit/documentation/UIKit/UIApplication/willEnterForegroundNotification`` regardless of whether your app uses <doc://com.apple.uikit/documentation/UIKit/scenes>.

In iOS 4.0 and later, UIKit calls this method as part of the transition from the background to the active state. You can use this method to undo many of the changes you made to your app upon entering the background. The call to this method is invariably followed by a call to the [`applicationDidBecomeActive(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationDidBecomeActive(_:)) method, which then moves the app from the inactive to the active state.

UIKit also posts a [`willEnterForegroundNotification`](/documentation/UIKit/UIApplication/willEnterForegroundNotification) shortly before calling this method to give interested objects a chance to respond to the transition.

---

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)