---
title: "setActions(_:for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uimutableusernotificationcategory/setactions(_:for:)"
---

# setActions(_:for:)

Sets the actions to display for different alert styles.

## Declaration

```swift
func setActions(_ actions: [UIUserNotificationAction]?, for context: UIUserNotificationActionContext)
```

## Parameters

- `actions`: An array of doc://com.apple.uikit/documentation/UIKit/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 nil or 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 doc://com.apple.uikit/documentation/UIKit/UIUserNotificationActionContext.

## Discussion

Discussion Use this method to set or change the actions associated with a specific context.

## See Also

### Modifying the action settings

- [identifier](uikit/uimutableusernotificationcategory/identifier.md)
