<!--
{
  "availability" : [
    "iOS: 8.0.0 - 10.0.0",
    "iPadOS: 8.0.0 - 10.0.0",
    "macCatalyst: 13.1.0 - 13.1.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIMutableUserNotificationCategory/setActions(_:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIMutableUserNotificationCategory(im)setActions:forContext:"
  },
  "title" : "setActions(_:for:)"
}
-->

# setActions(_:for:)

Sets the actions to display for different alert styles.

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

## Parameters

`actions`

An array of [`UIUserNotificationAction`](/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 [`UIUserNotificationActionContext`](/documentation/UIKit/UIUserNotificationActionContext).

## Discussion

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)