UIAlertController

class UIAlertController : UIViewController
  • Creates an alert view controller with a single confirmation button.

    Declaration

    Swift

    static func singleActionAlertController(title: String, message: String) -> UIAlertController

    Parameters

    title

    Title of the controller.

    message

    Message of the controller.

    Return Value

    Configured UIAlertController.

  • Creates an alert view controller with a destructive action.

    Declaration

    Swift

    static func deleteActionAlertController(title: String? = nil,
                                            message: String? = nil,
                                            deleteTitle: String?,
                                            handler: ((UIAlertAction) -> Void)? = nil) -> UIAlertController

    Parameters

    title

    Optional title of controller.

    message

    Optional message of controller.

    deleteTitle

    Title of destructive button.

    handler

    Handler.

    Return Value

    Configured UIAlertController.

  • Creates an alert view controller with dobule confirmation buttons.

    Declaration

    Swift

    static func doubleActionAlertController(title: String,
                                            message: String,
                                            actionOneTitle: String,
                                            actionTwoTitle: String,
                                            actionOne: (() -> Void)? = nil,
                                            actionTwo: (() -> Void)? = nil) -> UIAlertController

    Parameters

    title

    Title of the controller.

    message

    Message of the controller.

    actionOneTitle

    Alert action one title.

    actionTwoTitle

    Alert action two title.

    actionOne

    Alert action associated with action one button.

    actionTwo

    Alert action associated with action two button.

    Return Value

    Configured UIAlertController.

  • Creates an alert view controller with double confirmation buttons and a cancel button.

    Declaration

    Swift

    static func doubleButtonActionSheet(title: String? = nil,
                                        message: String? = nil,
                                        buttonOneTitle: String,
                                        buttonTwoTitle: String,
                                        actionButtonStyle: UIAlertActionStyle = .default,
                                        actionOne: (() -> Void)? = nil,
                                        actionTwo: (() -> Void)? = nil,
                                        cancelButtonTitle: String) -> UIAlertController

    Parameters

    title

    Title of the controller.

    message

    Message of the controller.

    buttonOneTitle

    Alert action button one title.

    buttonTwoTitle

    Alert action button two title.

    actionButtonStyle

    Action button style.

    actionOne

    Alert action associated with action one button.

    actionTwo

    Alert action associated with action two button.

    cancelButtonTitle

    Cancel button title.

    Return Value

    Configured UIAlertController.