---
title: UIApplication
framework: uikit
role: symbol
role_heading: Class
path: uikit/uiapplication
---

# UIApplication

The centralized point of control and coordination for apps running in iOS.

## Declaration

```swift
@MainActor class UIApplication
```

## Mentioned in

Using responders and the responder chain to handle events About app development with UIKit About the app launch sequence About the UI preservation process Handling key presses made on a physical keyboard

## Overview

Overview Every iOS app has exactly one instance of UIApplication (or, very rarely, a subclass of UIApplication). When an app launches, the system calls the UIApplicationMain(_:_:_:_:) function. Among its other tasks, this function creates a singleton UIApplication object that you access using shared. Your app’s application object handles the initial routing of incoming user events. It dispatches action messages forwarded to it by control objects (instances of the UIControl class) to appropriate target objects. The application object maintains a list of open windows (UIWindow objects), which it can use to retrieve any of the app’s UIView objects. The UIApplication class defines a delegate that conforms to the UIApplicationDelegate protocol and must implement some of the protocol’s methods. The application object informs the delegate of significant runtime events—for example, app launch, low-memory warnings, and app termination—giving it an opportunity to respond appropriately. Apps can cooperatively handle a resource, such as an email or an image file, through the open(_:options:completionHandler:) method. For example, an app that calls this method with an email URL causes the Mail app to launch and display the message. The APIs in this class allow you to manage device-specific behavior. Use your UIApplication object to do the following: Temporarily suspend incoming touch events (beginIgnoringInteractionEvents()) Register for remote notifications (registerForRemoteNotifications()) Trigger the undo-redo UI (applicationSupportsShakeToEdit) Determine whether there is an installed app registered to handle a URL scheme (canOpenURL(_:)) Extend the execution of the app so that it can finish a task in the background (beginBackgroundTask(expirationHandler:) and beginBackgroundTask(withName:expirationHandler:)) Schedule and cancel local notifications (scheduleLocalNotification(_:) and cancelLocalNotification(_:)) Coordinate the reception of remote-control events (beginReceivingRemoteControlEvents() and endReceivingRemoteControlEvents()) Perform app-level state restoration tasks (methods in the Managing state restoration task group) Subclassing notes Most apps don’t need to subclass UIApplication. Instead, use an app delegate to manage interactions between the system and the app. If your app must handle incoming events before the system does—a very rare situation—you can implement a custom event or action dispatching mechanism. To do this, subclass UIApplication and override the sendEvent(_:) and/or the sendAction(_:to:from:for:) methods. For every event you intercept, after you handle the event, dispatch it back to the system by calling: super.sendEvent(event) Intercepting events is only rarely required and you should avoid it if possible.

## Topics

### Accessing the shared application

- [shared](uikit/uiapplication/shared.md)

### Configuring your app’s behavior

- [delegate](uikit/uiapplication/delegate.md)
- [UIApplicationDelegate](uikit/uiapplicationdelegate.md)

### Registering for remote notifications

- [registerForRemoteNotifications()](uikit/uiapplication/registerforremotenotifications().md)
- [unregisterForRemoteNotifications()](uikit/uiapplication/unregisterforremotenotifications().md)
- [isRegisteredForRemoteNotifications](uikit/uiapplication/isregisteredforremotenotifications.md)

### Getting the application state

- [applicationState](uikit/uiapplication/applicationstate.md)
- [UIApplication.State](uikit/uiapplication/state.md)

### Getting scene information

- [supportsMultipleScenes](uikit/uiapplication/supportsmultiplescenes.md)
- [connectedScenes](uikit/uiapplication/connectedscenes.md)
- [openSessions](uikit/uiapplication/opensessions.md)

### Managing a scene’s life cycle

- [activateSceneSession(for:errorHandler:)](uikit/uiapplication/activatescenesession(for:errorhandler:).md)
- [requestSceneSessionDestruction(_:options:errorHandler:)](uikit/uiapplication/requestscenesessiondestruction(_:options:errorhandler:).md)
- [requestSceneSessionRefresh(_:)](uikit/uiapplication/requestscenesessionrefresh(_:).md)
- [UISceneSessionActivationRequest](uikit/uiscenesessionactivationrequest-swift.struct.md)
- [UIScene.ActivationRequestOptions](uikit/uiscene/activationrequestoptions.md)
- [UISceneDestructionRequestOptions](uikit/uiscenedestructionrequestoptions.md)

### Managing background tasks

- [backgroundRefreshStatus](uikit/uiapplication/backgroundrefreshstatus.md)
- [UIBackgroundRefreshStatus](uikit/uibackgroundrefreshstatus.md)
- [backgroundRefreshStatusDidChangeNotification](uikit/uiapplication/backgroundrefreshstatusdidchangenotification.md)
- [beginBackgroundTask(withName:expirationHandler:)](uikit/uiapplication/beginbackgroundtask(withname:expirationhandler:).md)
- [beginBackgroundTask(expirationHandler:)](uikit/uiapplication/beginbackgroundtask(expirationhandler:).md)
- [endBackgroundTask(_:)](uikit/uiapplication/endbackgroundtask(_:).md)
- [UIBackgroundTaskIdentifier](uikit/uibackgroundtaskidentifier.md)
- [backgroundTimeRemaining](uikit/uiapplication/backgroundtimeremaining.md)

### Fetching content in the background

- [backgroundFetchIntervalMinimum](uikit/uiapplication/backgroundfetchintervalminimum.md)
- [backgroundFetchIntervalNever](uikit/uiapplication/backgroundfetchintervalnever.md)

### Opening a URL resource

- [open(_:options:completionHandler:)](uikit/uiapplication/open(_:options:completionhandler:).md)
- [canOpenURL(_:)](uikit/uiapplication/canopenurl(_:).md)
- [UIApplication.OpenExternalURLOptionsKey](uikit/uiapplication/openexternalurloptionskey.md)

### Deep linking to custom settings

- [openSettingsURLString](uikit/uiapplication/opensettingsurlstring.md)
- [openNotificationSettingsURLString](uikit/uiapplication/opennotificationsettingsurlstring.md)
- [UIApplicationOpenNotificationSettingsURLString](uikit/uiapplicationopennotificationsettingsurlstring.md)
- [openDefaultApplicationsSettingsURLString](uikit/uiapplication/opendefaultapplicationssettingsurlstring.md)

### Managing the app’s idle timer

- [isIdleTimerDisabled](uikit/uiapplication/isidletimerdisabled.md)

### Managing state restoration

- [extendStateRestoration()](uikit/uiapplication/extendstaterestoration().md)
- [completeStateRestoration()](uikit/uiapplication/completestaterestoration().md)
- [ignoreSnapshotOnNextApplicationLaunch()](uikit/uiapplication/ignoresnapshotonnextapplicationlaunch().md)
- [registerObject(forStateRestoration:restorationIdentifier:)](uikit/uiapplication/registerobject(forstaterestoration:restorationidentifier:).md)

### Providing an app’s shortcut items

- [shortcutItems](uikit/uiapplication/shortcutitems.md)

### Accessing protected content

- [isProtectedDataAvailable](uikit/uiapplication/isprotecteddataavailable.md)
- [protectedDataDidBecomeAvailableNotification](uikit/uiapplication/protecteddatadidbecomeavailablenotification.md)
- [protectedDataWillBecomeUnavailableNotification](uikit/uiapplication/protecteddatawillbecomeunavailablenotification.md)

### Receiving remote control events

- [beginReceivingRemoteControlEvents()](uikit/uiapplication/beginreceivingremotecontrolevents().md)
- [endReceivingRemoteControlEvents()](uikit/uiapplication/endreceivingremotecontrolevents().md)

### Accessing the layout direction

- [userInterfaceLayoutDirection](uikit/uiapplication/userinterfacelayoutdirection.md)
- [UIUserInterfaceLayoutDirection](uikit/uiuserinterfacelayoutdirection.md)

### Controlling and handling events

- [sendEvent(_:)](uikit/uiapplication/sendevent(_:).md)
- [sendAction(_:to:from:for:)](uikit/uiapplication/sendaction(_:to:from:for:).md)
- [applicationSupportsShakeToEdit](uikit/uiapplication/applicationsupportsshaketoedit.md)

### Managing the app’s icon

- [supportsAlternateIcons](uikit/uiapplication/supportsalternateicons.md)
- [alternateIconName](uikit/uiapplication/alternateiconname.md)
- [setAlternateIconName(_:completionHandler:)](uikit/uiapplication/setalternateiconname(_:completionhandler:).md)

### Managing the preferred content size

- [preferredContentSizeCategory](uikit/uiapplication/preferredcontentsizecategory.md)
- [UIContentSizeCategory](uikit/uicontentsizecategory.md)
- [UIContentSizeCategoryAdjusting](uikit/uicontentsizecategoryadjusting.md)
- [didChangeNotification](uikit/uicontentsizecategory/didchangenotification.md)
- [newValueUserInfoKey](uikit/uicontentsizecategory/newvalueuserinfokey.md)

### Specifying the supported interface orientations

- [supportedInterfaceOrientations(for:)](uikit/uiapplication/supportedinterfaceorientations(for:).md)

### Tracking controls in the run loop

- [tracking](foundation/runloop/mode/tracking.md)

### Detecting screenshots

- [userDidTakeScreenshotNotification](uikit/uiapplication/userdidtakescreenshotnotification.md)

### Discovering if your app is the default app in a category

- [isDefault(_:)](uikit/uiapplication/isdefault(_:).md)
- [UIApplication.Category](uikit/uiapplication/category.md)
- [UIApplication.CategoryDefaultError](uikit/uiapplication/categorydefaulterror.md)

### Deprecated

- [Deprecated symbols](uikit/uiapplication-deprecated-symbols.md)

### Structures

- [UIApplication.BackgroundRefreshStatusDidChangeMessage](uikit/uiapplication/backgroundrefreshstatusdidchangemessage.md)
- [UIApplication.DidBecomeActiveMessage](uikit/uiapplication/didbecomeactivemessage.md)
- [UIApplication.DidEnterBackgroundMessage](uikit/uiapplication/didenterbackgroundmessage.md)
- [UIApplication.DidFinishLaunchingMessage](uikit/uiapplication/didfinishlaunchingmessage.md)
- [UIApplication.DidReceiveMemoryWarningMessage](uikit/uiapplication/didreceivememorywarningmessage.md)
- [UIApplication.ProtectedDataDidBecomeAvailableMessage](uikit/uiapplication/protecteddatadidbecomeavailablemessage.md)
- [UIApplication.ProtectedDataWillBecomeUnavailableMessage](uikit/uiapplication/protecteddatawillbecomeunavailablemessage.md)
- [UIApplication.SignificantTimeChangeMessage](uikit/uiapplication/significanttimechangemessage.md)
- [UIApplication.UserDidTakeScreenshotMessage](uikit/uiapplication/userdidtakescreenshotmessage.md)
- [UIApplication.WillEnterForegroundMessage](uikit/uiapplication/willenterforegroundmessage.md)
- [UIApplication.WillResignActiveMessage](uikit/uiapplication/willresignactivemessage.md)
- [UIApplication.WillTerminateMessage](uikit/uiapplication/willterminatemessage.md)

## Relationships

### Inherits From

- [UIResponder](uikit/uiresponder.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSTouchBarProvider](appkit/nstouchbarprovider.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [UIActivityItemsConfigurationProviding](uikit/uiactivityitemsconfigurationproviding.md)
- [UIPasteConfigurationSupporting](uikit/uipasteconfigurationsupporting.md)
- [UIResponderStandardEditActions](uikit/uiresponderstandardeditactions.md)
- [UIUserActivityRestoring](uikit/uiuseractivityrestoring.md)

## See Also

### Life cycle

- [Managing your app’s life cycle](uikit/managing-your-app-s-life-cycle.md)
- [Responding to the launch of your app](uikit/responding-to-the-launch-of-your-app.md)
- [UIApplicationDelegate](uikit/uiapplicationdelegate.md)
- [Scenes](uikit/scenes.md)
- [Transitioning to the UIKit scene-based life cycle](uikit/transitioning-to-the-uikit-scene-based-life-cycle.md)
