Instance Method

addAction:

Attaches an action object to the alert or action sheet.

Declaration

- (void)addAction:(UIAlertAction *)action;

Parameters

action

The action object to display as part of the alert. Actions are displayed as buttons in the alert. The action object provides the button text and the action to be performed when that button is tapped.

Discussion

If your alert has multiple actions, the order in which you add those actions determines their order in the resulting alert or action sheet.

See Also

Configuring the User Actions

actions

The actions that the user can take in response to the alert or action sheet.

preferredAction

The preferred action for the user to take from an alert.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software