A
UIAlertControllerobject displays an alert message to the user. This class replaces theUIActionSheetandUIAlertViewclasses for displaying alerts. After configuring the alert controller with the actions and style you want, present it using thepresentViewController:animated:completion:method.