- iOS 8.0–10.0Deprecated
- Mac Catalyst 13.0–13.0Deprecated
When a notification is delivered, the system displays a button for each custom action associated with the notification. Tapping a button launches your app (either in the foreground or background) and gives you a chance to perform the indicated action. You use this class to configure the details about the button that is displayed and the information your app needs to perform the corresponding action.
To associate custom actions with a local or remote notification, create one or more instances of this class and use them to configure one or more UIMutableUserNotificationActionSettings objects. An action settings objects defines the set of actions to associate with a single notification. You register your app’s action settings objects at launch time, along with your app’s preferred notification options, using a
For each action you define, you must specify whether execution of that action requires the app to be running in the foreground or background. You can also specify whether the device must be unlocked or can remain locked while the action is performed. Unlocking the device may be necessary if the action involves reading or writing files that are encrypted on disk using the system’s data protection mechanism. When the user selects an action, the system puts your app into the appropriate mode and calls your app delegate’s
application(_:handleActionWithIdentifier:for:completionHandler:) method to perform the action.
Getting the Action Information
Configuring the Action’s Behavior
A preview action, or peek quick action, that is displayed below a peek when a user swipes the peek upward.
In apps that run in versions of iOS prior to iOS 8, use the
UIAlertView class to display an alert message to the user. An alert view functions similar to but differs in appearance from an action sheet (an instance of
UILocalNotification is deprecated in iOS 10. Use
UNNotificationRequest instead. A
UILocalNotification object specifies a notification that an app can schedule for presentation at a specific date and time.
UIMutableUserNotificationCategory is deprecated in iOS 10. Use
UNNotificationCategory instead. A
UIMutableUserNotificationCategory object encapsulates information about custom actions that your app can perform in response to a local or push notification. Use instances of this class to customize the actions included in an alert when space onscreen is constrained.
UIStoryboardPopoverSegue class defines a specific type of segue for presenting content in a popover. For popover segues, the destination view controller contains the content to be displayed in the popover. This class provides an additional
popoverController property so that your custom code has access to the popover controller object. For example, you might want to store the popover controller elsewhere in your code so that you can dismiss the popover programmatically.
UIUserNotificationAction is deprecated in iOS 10. Use
UNNotificationAction instead. A
UIUserNotificationAction object represents a custom action that your app can perform in response to a remote or local notification.
UIUserNotificationCategory is deprecated in iOS 10. Use
UNNotificationCategory instead. A
UIUserNotificationCategory object encapsulates information about custom actions that your app can perform in response to a local or push notification.