Creates and returns a view controller for displaying an alert to the user.
- iOS 8.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
The title of the alert. Use this string to get the user’s attention and communicate the reason for the alert.
Descriptive text that provides additional details about the reason for the alert.
The style to use when presenting the alert controller. Use this parameter to configure the alert controller as an action sheet or as a modal alert.
An initialized alert controller object.
After creating the alert controller, configure any actions that you want the user to be able to perform by calling the
add method one or more times. When specifying a preferred style of
UIAlert, you may also configure one or more text fields to display in addition to the actions.