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)?)
-
presentAlertWithOk(title:message:actionHandler:)Extension methodPresent a pop-up alert with only an
OK
button.Declaration
Swift
func presentAlertWithOk(title: String?, message: String, actionHandler: ((UIAlertAction) -> Void)?)Parameters
titleThe title to display in the popup.
messageThe message to display in the popup.
actionHandlerThe action handler to call when completed.
-
presentAlertWithYesNo(title:message:actionHandler:)Extension methodPresent a pop-up alert with a
Yes
andNo
button. The alert will be presented with yes and no buttons. The handler will be called withfalseif the user selectedNo
andtrueif the user selectedYes
.Declaration
Swift
func presentAlertWithYesNo(title: String?, message: String, actionHandler: @escaping ((Bool) -> Void))Parameters
titleThe title to display in the popup.
messageThe message to display in the popup.
actionHandlerThe action handler to call when completed.
-
presentAlertWithActions(title:message:preferredStyle:actions:)Extension methodPresent an alert with the provided list of actions.
Declaration
Swift
func presentAlertWithActions(title: String?, message: String, preferredStyle: UIAlertController.Style, actions: [UIAlertAction])Parameters
titleThe title to display in the popup.
messageThe message to display in the popup.
preferredStyleThe preferred style of the alert.
actionsThe actions to add to the alert controller.
View on GitHub
RSDAlertPresenter Protocol Reference