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