Instance Method

addTextFieldWithConfigurationHandler:

Adds a text field to an alert.

Declaration

- (void)addTextFieldWithConfigurationHandler:(void (^)(UITextField *textField))configurationHandler;

Parameters

configurationHandler

A block for configuring the text field prior to displaying the alert. This block has no return value and takes a single parameter corresponding to the text field object. Use that parameter to change the text field properties.

Discussion

Calling this method adds an editable text field to the alert. You can call this method more than once to add additional text fields. The text fields are stacked in the resulting alert.

You can add a text field only if the preferredStyle property is set to UIAlertControllerStyleAlert.

See Also

Configuring Text Fields

textFields

The array of text fields displayed by the alert.