UIAlertController
extension UIAlertController
-
Adds a UIAlertAction, initialized with a title, style, and completion handler.
Declaration
Swift
@discardableResult public func addAction(title: String?, style: UIAlertAction.Style = .default, handler: ((UIAlertAction) -> Void)? = nil) -> SelfParameters
titleThe text to use for the action title.
styleThe style to use for the action (optional, defaults to
.default).handlerA closure to execute when the user selects the action (optional, defaults to
nil).Return Value
self
-
Creates a UIAlertController instance, styled as an action sheet.
Declaration
Swift
public static func actionSheet(title: String? = nil, message: String? = nil) -> UIAlertControllerParameters
titleThe title for the controller (optional, defaults to
nil).messageThe message for the controller (optional, defaults to
nil).Return Value
A UIAlertController instance, styled as an action sheet.
-
Creates a UIAlertController instance, styled as an alert.
Declaration
Swift
public static func alert(title: String? = nil, message: String? = nil) -> UIAlertControllerParameters
titleThe title for the controller (optional, defaults to
nil).messageThe message for the controller (optional, defaults to
nil).Return Value
A UIAlertController instance, styled as an alert.
View on GitHub
Install in Dash
UIAlertController Extension Reference