Class

CPAlertAction

An action displayed on an alert as a button.

Declaration

@interface CPAlertAction : NSObject

Overview

Use an alert action to display a button on an alert. The combination of the alert and action styles determine the appearance of the action button. To perform an action after the user taps the button, provide a block to the action’s handler property.

Topics

Creating an Alert Action

- initWithTitle:style:handler:

Initializes an alert action with a title, style, and action handler.

Getting the Title

title

The action button's title.

Getting the Action Style

style

The display style for the action button.

CPAlertActionStyle

Display styles for an alert’s action button.

Getting the Action Handler

handler

The block invoked after the user taps the action button.

CPAlertActionHandler

The declaration for an alert action handler.

Relationships

Inherits From

Conforms To

See Also

Action Sheets and Alerts

CPActionSheetTemplate

A template for displaying an action sheet on the CarPlay screen.

CPAlertTemplate

A template for displaying alerts on the CarPlay screen.