For UIApplicationDelegate
The app delegate performs several crucial roles:
-
It contains your app’s startup code.
-
It responds to key changes in the state of your app. Specifically, it responds to both temporary interruptions and to changes in the execution state of your app, such as when your app transitions from the foreground to the background.
-
It responds to notifications originating from outside the app, such as remote notifications (also known as push notifications), low-memory warnings, download completion notifications, and more.
-
It determines whether state preservation and restoration should occur and assists in the preservation and restoration process as needed.
-
It responds to events that target the app itself and are not specific to your app’s views or view controllers.
-
You can use it to store your app’s central data objects or any content that does not have an owning view controller.
For UIApplication
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 (
unregisterForRemoteNotifications
) -
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 (
beginBackgroundTaskWithExpirationHandler:
,beginBackgroundTaskWithName:expirationHandler:
) -
Schedule and cancel local notifications (
scheduleLocalNotification:
,cancelLocalNotification:
) -
Coordinate the reception of remote-control events (
beginReceivingRemoteControlEvents
,endReceivingRemoteControlEvents
) -
Perform app-level state restoration tasks (methods in the Managing the State Restoration Behavior task group)