---
title: "init(title:style:handler:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uialertaction/init(title:style:handler:)"
---

# init(title:style:handler:)

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

## Declaration

```swift
convenience init(title: String?, style: UIAlertAction.Style, handler: ((UIAlertAction) -> Void)? = nil)
```

## Parameters

- `title`: The text to use for the button title. The value you specify should be localized for the user’s current language. This parameter must not be nil, except in a tvOS app where a nil title may be used with doc://com.apple.uikit/documentation/UIKit/UIAlertAction/Style-swift.enum/cancel.
- `style`: Additional styling information to apply to the button. Use the style information to convey the type of action that is performed by the button. For a list of possible values, see the constants in doc://com.apple.uikit/documentation/UIKit/UIAlertAction/Style-swift.enum.
- `handler`: A block to execute when the user selects the action. This block has no return value and takes the selected action object as its only parameter.

## Return Value

Return Value A new alert action object.

## Discussion

Discussion Actions are enabled by default when you create them.
