---
title: WKAlertAction
framework: watchkit
role: symbol
role_heading: Class
path: watchkit/wkalertaction
---

# WKAlertAction

An object that encapsulates information about a button displayed in an alert or action sheet.

## Declaration

```swift
class WKAlertAction
```

## Overview

Overview Create instances of this class using the init(title:style:handler:) method and pass them to the presentAlert(withTitle:message:preferredStyle:actions:) method of one of your interface controllers. The sheet uses your action objects to create the corresponding buttons. When creating an alert action, you specify the title and visual style to apply to the button and a block to execute when the button is tapped. Use the defined visual styles to convey the purpose of the button to the user.

## Topics

### Creating an Action

- [init(title:style:handler:)](watchkit/wkalertaction/init(title:style:handler:).md)

### Constants

- [WKAlertActionStyle](watchkit/wkalertactionstyle.md)
- [WKAlertActionHandler](watchkit/wkalertactionhandler.md)

## Relationships

### Inherits From

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

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### User interface basics

- [Building watchOS app Interfaces Using the Storyboard](watchkit/building-watchos-app-interfaces-using-the-storyboard.md)
- [WKInterfaceObject](watchkit/wkinterfaceobject.md)
- [WKInterfaceController](watchkit/wkinterfacecontroller.md)
- [WKAccessibilityImageRegion](watchkit/wkaccessibilityimageregion.md)
- [WKAccessibilityIsVoiceOverRunning()](watchkit/wkaccessibilityisvoiceoverrunning().md)
- [WKAccessibilityIsReduceMotionEnabled()](watchkit/wkaccessibilityisreducemotionenabled().md)
