Initializer

init(identifier:title:options:)

Creates an action object with the specified title and options.

Declaration

convenience init(identifier: String, title: String, options: UNNotificationActionOptions = [])

Parameters

identifier

The string that you use internally to identify the action. This string must be unique among all of your app's supported actions. When the user selects the action, the system passes this string to your app and asks you to perform the related task. This parameter must not be nil or an empty string.

title

The localized string to display to the user. This string is used as the title of a button, which is added to the notification interface. This parameter must not be nil.

options

Additional options describing how the action behaves. Include options when you need the related behavior. For a list of possible values, see UNNotificationActionOptions.

Return Value

An initialized action object.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software