UIViewController
internal extension UIViewController
-
Present a
UIAlertController
with a default action button.Declaration
Swift
@discardableResult func presentAlertController(title: String?, message: String?, defaultActionButtonTitle: String = "OK", handler: ((UIAlertAction) -> Void)? = nil) -> UIAlertController
Parameters
title
The title of the alert. Use this string to get the user’s attention and communicate the reason for the alert.
message
Descriptive text that provides additional details about the reason for the alert.
defaultActionButtonTitle
The text to use for the default button’s title. The value you specify should be localized for the user’s current language.
handler
A block to execute when the user selects the default action. This block has no return value and takes the selected action object as its only parameter.
Return Value
the presented alert controller.