RSDAlertPresenter

@objc
public protocol RSDAlertPresenter : NSObjectProtocol

Utility for presenting alerts

  • Present a view controller using a modal presentation.

    Declaration

    Swift

    func presentModal(_ viewController: UIViewController, animated: Bool, completion: (() -> Void)?)
  • Present a pop-up alert with only an OK button.

    Declaration

    Swift

    func presentAlertWithOk(title: String?, message: String, actionHandler: ((UIAlertAction) -> Void)?)

    Parameters

    title

    The title to display in the popup.

    message

    The message to display in the popup.

    actionHandler

    The action handler to call when completed.

  • Present a pop-up alert with a Yes and No button. The alert will be presented with yes and no buttons. The handler will be called with false if the user selected No and true if the user selected Yes.

    Declaration

    Swift

    func presentAlertWithYesNo(title: String?, message: String, actionHandler: @escaping ((Bool) -> Void))

    Parameters

    title

    The title to display in the popup.

    message

    The message to display in the popup.

    actionHandler

    The action handler to call when completed.

  • Present an alert with the provided list of actions.

    Declaration

    Swift

    func presentAlertWithActions(title: String?, message: String, preferredStyle: UIAlertController.Style, actions: [UIAlertAction])

    Parameters

    title

    The title to display in the popup.

    message

    The message to display in the popup.

    preferredStyle

    The preferred style of the alert.

    actions

    The actions to add to the alert controller.