Type Method

actionWithTitle:style:handler:

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

Declaration

+ (instancetype)actionWithTitle:(NSString *)title style:(WKAlertActionStyle)style handler:(WKAlertActionHandler)handler;

Parameters

title

The localized string to use as the button title for the action.

style

The style to apply to the action button. For a list of possible styles and their meanings, see WKAlertActionStyle.

handler

A block containing the code to execute when the user taps the action button. Use this block to perform whatever action is required to perform the associated task. For information about the format of this block, see WKAlertActionHandler.

Return Value

An initialized action object that you can display in an alert.

Discussion

Use this method to create a button to display in an action sheet. In an action sheet, specifying an action with the WKAlertActionStyleCancel style replaces the standard Cancel button provided by the system.