<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIApplicationDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIApplicationDelegate"
  },
  "title" : "UIApplicationDelegate"
}
-->

# UIApplicationDelegate

A set of methods to manage shared behaviors for your app.

```
@MainActor protocol UIApplicationDelegate : NSObjectProtocol
```

## Overview

Your app delegate object manages your app’s shared behaviors. The app delegate is effectively the root object of your app, and it works in conjunction with [`UIApplication`](/documentation/UIKit/UIApplication) to manage some interactions with the system. Like the [`UIApplication`](/documentation/UIKit/UIApplication) object, UIKit creates your app delegate object early in your app’s launch cycle so it’s always present.

Use your app delegate object to handle the following tasks:

- Initializing your app’s central data structures
- Configuring your app’s scenes
- Responding to notifications originating from outside the app, such as low-memory warnings, download completion notifications, and more
- Responding to events that target the app itself, and aren’t specific to your app’s scenes, views, or view controllers
- Registering for any required services at launch time, such as Apple Push Notification service

For more information about how you use the app delegate object to initialize your app at launch time, see [Responding to the launch of your app](/documentation/UIKit/responding-to-the-launch-of-your-app).

### Life-cycle management in iOS 12 and earlier

In iOS 12 and earlier, you use your app delegate to manage major life cycle events in your app. Specifically, you use methods of the app delegate to update the state of your app when it enters the foreground or moves to the background.

- For information on what to do when your app enters the foreground, see [Preparing your UI to run in the foreground](/documentation/UIKit/preparing-your-ui-to-run-in-the-foreground).
- For information on what to do when your app enters the background, see [Preparing your UI to run in the background](/documentation/UIKit/preparing-your-ui-to-run-in-the-background).
- For general information about the life cycle of your app, see [Managing your app’s life cycle](/documentation/UIKit/managing-your-app-s-life-cycle).

## Topics

### Initializing the app

[`application(_:willFinishLaunchingWithOptions:)`](/documentation/UIKit/UIApplicationDelegate/application(_:willFinishLaunchingWithOptions:))

Tells the delegate that the launch process has begun.

[`application(_:didFinishLaunchingWithOptions:)`](/documentation/UIKit/UIApplicationDelegate/application(_:didFinishLaunchingWithOptions:))

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

[`UIApplication.LaunchOptionsKey`](/documentation/UIKit/UIApplication/LaunchOptionsKey)

The keys you use to access values in the launch options dictionary that the system passes to your app at initialization.

[`didFinishLaunchingNotification`](/documentation/UIKit/UIApplication/didFinishLaunchingNotification)

A notification that posts immediately after the app finishes launching.

### Configuring and discarding scenes

[`application(_:configurationForConnecting:options:)`](/documentation/UIKit/UIApplicationDelegate/application(_:configurationForConnecting:options:))

Retrieves the configuration data for UIKit to use when creating a new scene.

[`application(_:didDiscardSceneSessions:)`](/documentation/UIKit/UIApplicationDelegate/application(_:didDiscardSceneSessions:))

Tells the delegate that the user closed one or more of the app’s scenes from the app switcher.

### Responding to app life-cycle events

[`applicationDidBecomeActive(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationDidBecomeActive(_:))

Tells the delegate that the app has become active.

[`applicationWillResignActive(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationWillResignActive(_:))

Tells the delegate that the app is about to become inactive.

[`applicationDidEnterBackground(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationDidEnterBackground(_:))

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

[`applicationWillEnterForeground(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationWillEnterForeground(_:))

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

[`applicationWillTerminate(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationWillTerminate(_:))

Tells the delegate when the app is about to terminate.

[`didBecomeActiveNotification`](/documentation/UIKit/UIApplication/didBecomeActiveNotification)

A notification that posts when the app becomes active.

[`didEnterBackgroundNotification`](/documentation/UIKit/UIApplication/didEnterBackgroundNotification)

A notification that posts when the app enters the background.

[`willEnterForegroundNotification`](/documentation/UIKit/UIApplication/willEnterForegroundNotification)

A notification that posts shortly before an app leaves the background state on its way to becoming the active app.

[`willResignActiveNotification`](/documentation/UIKit/UIApplication/willResignActiveNotification)

A notification that posts when the app is no longer active and loses focus.

[`willTerminateNotification`](/documentation/UIKit/UIApplication/willTerminateNotification)

A notification that posts when the app is about to terminate.

### Responding to environment changes

[`applicationProtectedDataDidBecomeAvailable(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationProtectedDataDidBecomeAvailable(_:))

Tells the delegate that protected files are available now.

[`applicationProtectedDataWillBecomeUnavailable(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationProtectedDataWillBecomeUnavailable(_:))

Tells the delegate that the protected files are about to become unavailable.

[`applicationDidReceiveMemoryWarning(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationDidReceiveMemoryWarning(_:))

Tells the delegate when the app receives a memory warning from the system.

[`applicationSignificantTimeChange(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationSignificantTimeChange(_:))

Tells the delegate when there is a significant change in the time.

[`protectedDataDidBecomeAvailableNotification`](/documentation/UIKit/UIApplication/protectedDataDidBecomeAvailableNotification)

A notification that posts when the protected files become available for your code to access.

[`protectedDataWillBecomeUnavailableNotification`](/documentation/UIKit/UIApplication/protectedDataWillBecomeUnavailableNotification)

A notification that posts shortly before protected files are locked down and become inaccessible.

[`didReceiveMemoryWarningNotification`](/documentation/UIKit/UIApplication/didReceiveMemoryWarningNotification)

A notification that posts when the app receives a warning from the operating system about low memory availability.

[`significantTimeChangeNotification`](/documentation/UIKit/UIApplication/significantTimeChangeNotification)

A notification that posts when there’s a significant change in time.

### Managing app state restoration

[`application(_:shouldSaveSecureApplicationState:)`](/documentation/UIKit/UIApplicationDelegate/application(_:shouldSaveSecureApplicationState:))

Asks the delegate whether to securely preserve the app’s state.

[`application(_:shouldRestoreSecureApplicationState:)`](/documentation/UIKit/UIApplicationDelegate/application(_:shouldRestoreSecureApplicationState:))

Asks the delegate whether to restore the app’s saved state.

[`application(_:viewControllerWithRestorationIdentifierPath:coder:)`](/documentation/UIKit/UIApplicationDelegate/application(_:viewControllerWithRestorationIdentifierPath:coder:))

Asks the delegate to provide the specified view controller.

[`application(_:willEncodeRestorableStateWith:)`](/documentation/UIKit/UIApplicationDelegate/application(_:willEncodeRestorableStateWith:))

Tells your delegate to save any high-level state information at the beginning of the state preservation process.

[`application(_:didDecodeRestorableStateWith:)`](/documentation/UIKit/UIApplicationDelegate/application(_:didDecodeRestorableStateWith:))

Tells your delegate to restore any high-level state information as part of the state restoration process.

[`stateRestorationBundleVersionKey`](/documentation/UIKit/UIApplication/stateRestorationBundleVersionKey)

The version of your app responsible for creating the restoration archive.

[`stateRestorationSystemVersionKey`](/documentation/UIKit/UIApplication/stateRestorationSystemVersionKey)

The version of the system on which your app created the restoration archive.

[`stateRestorationTimestampKey`](/documentation/UIKit/UIApplication/stateRestorationTimestampKey)

The time your app created the restoration archive.

[`stateRestorationUserInterfaceIdiomKey`](/documentation/UIKit/UIApplication/stateRestorationUserInterfaceIdiomKey)

The user interface idiom that was in effect when your app created the restoration archive.

[`stateRestorationViewControllerStoryboardKey`](/documentation/UIKit/UIApplication/stateRestorationViewControllerStoryboardKey)

A reference to the storyboard that contains the view controller.

### Downloading data in the background

[`application(_:handleEventsForBackgroundURLSession:completionHandler:)`](/documentation/UIKit/UIApplicationDelegate/application(_:handleEventsForBackgroundURLSession:completionHandler:))

Tells the delegate that events related to a URL session are waiting to be processed.

[`UIBackgroundFetchResult`](/documentation/UIKit/UIBackgroundFetchResult)

Constants that indicate the result of a background fetch operation.

### Handling remote notification registration

[`application(_:didRegisterForRemoteNotificationsWithDeviceToken:)`](/documentation/UIKit/UIApplicationDelegate/application(_:didRegisterForRemoteNotificationsWithDeviceToken:))

Tells the delegate that the app successfully registered with Apple Push Notification service (APNs).

[`application(_:didFailToRegisterForRemoteNotificationsWithError:)`](/documentation/UIKit/UIApplicationDelegate/application(_:didFailToRegisterForRemoteNotificationsWithError:))

Tells the delegate when Apple Push Notification service cannot successfully complete the registration process.

[`application(_:didReceiveRemoteNotification:fetchCompletionHandler:)`](/documentation/UIKit/UIApplicationDelegate/application(_:didReceiveRemoteNotification:fetchCompletionHandler:))

Tells the app that a remote notification arrived that indicates there is data to be fetched.

### Continuing user activity and handling quick actions

[`application(_:willContinueUserActivityWithType:)`](/documentation/UIKit/UIApplicationDelegate/application(_:willContinueUserActivityWithType:))

Tells the delegate if your app takes responsibility for notifying users when a continuation activity takes longer than expected.

[`application(_:continue:restorationHandler:)`](/documentation/UIKit/UIApplicationDelegate/application(_:continue:restorationHandler:))

Tells the delegate that the data for continuing an activity is available.

[`application(_:didUpdate:)`](/documentation/UIKit/UIApplicationDelegate/application(_:didUpdate:))

Tells the delegate that the activity was updated.

[`application(_:didFailToContinueUserActivityWithType:error:)`](/documentation/UIKit/UIApplicationDelegate/application(_:didFailToContinueUserActivityWithType:error:))

Tells the delegate that the activity couldn’t be continued.

[`application(_:performActionFor:completionHandler:)`](/documentation/UIKit/UIApplicationDelegate/application(_:performActionFor:completionHandler:))

Tells the delegate that the user selected a Home screen quick action for your app, except when you’ve intercepted the interaction in a launch method.

### Interacting with WatchKit

[`application(_:handleWatchKitExtensionRequest:reply:)`](/documentation/UIKit/UIApplicationDelegate/application(_:handleWatchKitExtensionRequest:reply:))

Asks the delegate to respond to a request from a paired watchOS app.

### Interacting with HealthKit

[`applicationShouldRequestHealthAuthorization(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationShouldRequestHealthAuthorization(_:))

Tells the delegate when your app should ask the user for access to his or her HealthKit data.

### Opening a URL-specified resource

[`application(_:open:options:)`](/documentation/UIKit/UIApplicationDelegate/application(_:open:options:))

Asks the delegate to open a resource specified by a URL, and provides a dictionary of launch options.

[`UIApplication.OpenURLOptionsKey`](/documentation/UIKit/UIApplication/OpenURLOptionsKey)

Keys you use to access values in the options dictionary when opening a URL.

### Disallowing specified app extension types

[`application(_:shouldAllowExtensionPointIdentifier:)`](/documentation/UIKit/UIApplicationDelegate/application(_:shouldAllowExtensionPointIdentifier:))

Asks the delegate to grant permission to use app extensions that are based on a specified extension point identifier.

[`UIApplication.ExtensionPointIdentifier`](/documentation/UIKit/UIApplication/ExtensionPointIdentifier)

A structure that identifies types of extensions.

[`keyboard`](/documentation/UIKit/UIApplication/ExtensionPointIdentifier/keyboard)

The identifier for custom keyboards.

### Handling SiriKit intents

[`application(_:handlerFor:)`](/documentation/UIKit/UIApplicationDelegate/application(_:handlerFor:))

Asks the delegate for an intent handler capable of handling the specified intent.

### Handling CloudKit invitations

[`application(_:userDidAcceptCloudKitShareWith:)`](/documentation/UIKit/UIApplicationDelegate/application(_:userDidAcceptCloudKitShareWith:))

Tells the delegate that the app now has access to shared information in CloudKit.

### Localizing keyboard shortcuts

[`applicationShouldAutomaticallyLocalizeKeyCommands(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationShouldAutomaticallyLocalizeKeyCommands(_:))

Returns a Boolean value that tells the system whether to remap menu shortcuts to support localized keyboards.

### Managing interface geometry

[`application(_:supportedInterfaceOrientationsFor:)`](/documentation/UIKit/UIApplicationDelegate/application(_:supportedInterfaceOrientationsFor:))

Asks the delegate for the interface orientations to use for the view controllers in the specified window.

[`UIInterfaceOrientation`](/documentation/UIKit/UIInterfaceOrientation)

Constants that specify the orientation of the app’s user interface.

[`UIInterfaceOrientationMask`](/documentation/UIKit/UIInterfaceOrientationMask)

Constants that specify a view controller’s supported interface orientations.

[`invalidInterfaceOrientationException`](/documentation/UIKit/UIApplication/invalidInterfaceOrientationException)

An exception that’s thrown if a view controller or the app returns an invalid set of supported interface orientations.

### Providing a window for storyboarding

[`window`](/documentation/UIKit/UIApplicationDelegate/window)

The window to use when presenting a storyboard.

### Providing the main entry point

[`main()`](/documentation/UIKit/UIApplicationDelegate/main())

Provides the top-level entry point for the app.

### Deprecated

[`applicationDidFinishLaunching(_:)`](/documentation/UIKit/UIApplicationDelegate/applicationDidFinishLaunching(_:))

Tells the delegate when the app has finished launching.

[Deprecated symbols](/documentation/UIKit/uiapplicationdelegate-deprecated-symbols)

Symbols that are no longer supported.



---

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)