<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIAlertAction",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIAlertAction"
  },
  "title" : "UIAlertAction"
}
-->

# UIAlertAction

An action that can be taken when the user taps a button in an alert.

```
@MainActor class UIAlertAction
```

## Overview

You use this class to configure information about a single action, including the title to display in the button, any styling information, and a handler to execute when the user taps the button. After creating an alert action object, add it to a [`UIAlertController`](/documentation/UIKit/UIAlertController) object before displaying the corresponding alert to the user.

## Topics

### Creating an alert action

[`init(title:style:handler:)`](/documentation/UIKit/UIAlertAction/init(title:style:handler:))

Create and return an action with the specified title and behavior.

### Getting the action’s attributes

[`title`](/documentation/UIKit/UIAlertAction/title)

The title of the action’s button.

[`style`](/documentation/UIKit/UIAlertAction/style-swift.property)

The style that applies to the action’s button.

[`isEnabled`](/documentation/UIKit/UIAlertAction/isEnabled)

A Boolean value indicating whether the action is currently enabled.

### Constants

[`UIAlertAction.Style`](/documentation/UIKit/UIAlertAction/Style-swift.enum)

Styles to apply to action buttons in an alert.



---

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)