Alert Controllers

To allow the user to choose a photo source, you will present an alert with the possible choices. Alerts are often used to display information the user must act on. When you want to display an alert, you create an instance of UIAlertController with a preferred style. The two available styles are UIAlertControllerStyle.actionSheet and UIAlertControllerStyle.alert (Figure 14.9).

Figure 14.9  UIAlertController styles

UIAlertController styles

The .actionSheet style is used to present the user with a list of actions to choose from. The .alert type is used to display critical information and requires the user to decide how to proceed. ...

Get iOS Programming: The Big Nerd Ranch Guide, 7th 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.