O'Reilly logo

iOS Programming: The Big Nerd Ranch Guide, 6th Edition by Aaron Hillegass, Christian Keur

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Displaying User Alerts

In this section, you are going to learn about user alerts and the different ways of configuring and displaying them. User alerts can provide your application with a better user experience, so you will use them fairly often.

Alerts are often used to warn users that an important action is about to happen and perhaps give them the opportunity to cancel that action. 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 11.9).

Figure 11.9  UIAlertController styles

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required