Kinds of Alerts

The alertViewStyle property allows you to create several alert styles. The default style (UIAlertViewStyleDefault) creates a standard alert, with a title and message text, followed by buttons, as shown in Figure 3-1. It is the bread and butter of the alert world, allowing you to query for button presses such as Yes/No, Cancel/OK, and other simple choices.

iOS offers three more styles, specifically for entering text:

Image UIAlertViewStylePlainTextInputThis alert style enables users to enter text.

Image UIAlertViewStyleSecureTextInputWhen ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.