<!--
{
  "availability" : [
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WatchKit",
  "identifier" : "/documentation/WatchKit/WKAlertAction",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "WatchKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKAlertAction"
  },
  "title" : "WKAlertAction"
}
-->

# WKAlertAction

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

```
class WKAlertAction
```

## Overview

Create instances of this class using the [`init(title:style:handler:)`](/documentation/WatchKit/WKAlertAction/init(title:style:handler:)) method and pass them to the [`presentAlert(withTitle:message:preferredStyle:actions:)`](/documentation/WatchKit/WKInterfaceController/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:)`](/documentation/WatchKit/WKAlertAction/init(title:style:handler:))

Creates and returns an action object with the specified button information.

### Constants

[`WKAlertActionStyle`](/documentation/WatchKit/WKAlertActionStyle)

Constants indicating the style of the action button.

[`WKAlertActionHandler`](/documentation/WatchKit/WKAlertActionHandler)

A block to perform in response to an action.



---

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)