setActions(_:for:)
Sets the actions to display for different alert styles.
Declaration
func setActions(_ actions: [UIUserNotificationAction]?, for context: UIUserNotificationActionContext)Parameters
- actions:
An array of Uiusernotificationaction objects representing the actions to display for the given context. When displaying the notification to the user, the system displays the action buttons using the same order as the items in this array. If you specify
nilor an empty array, this method removes the actions for the specified context. - context:
The context in which the alert is displayed. For a list of possible values, see Uiusernotificationactioncontext.
Discussion
Use this method to set or change the actions associated with a specific context.