---
title: UIAlertAction
framework: uikit
role: symbol
role_heading: Class
path: uikit/uialertaction
---

# UIAlertAction

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

## Declaration

```swift
@MainActor class UIAlertAction
```

## Mentioned in

Getting the user’s attention with alerts and action sheets

## Overview

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 object before displaying the corresponding alert to the user.

## Topics

### Creating an alert action

- [init(title:style:handler:)](uikit/uialertaction/init(title:style:handler:).md)

### Getting the action’s attributes

- [title](uikit/uialertaction/title.md)
- [style](uikit/uialertaction/style-swift.property.md)
- [isEnabled](uikit/uialertaction/isenabled.md)

### Constants

- [UIAlertAction.Style](uikit/uialertaction/style-swift.enum.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [UIAccessibilityIdentification](uikit/uiaccessibilityidentification.md)

## See Also

### Alerts

- [Getting the user’s attention with alerts and action sheets](uikit/getting-the-user-s-attention-with-alerts-and-action-sheets.md)
- [UIAlertController](uikit/uialertcontroller.md)
