AlertHandler
class AlertHandler : NSObject
This is a class for handling Alerts
-
Call this function for showing alert with a single OK button in your View Controller.
Usage:
AlertHandler.present(self, title: "Hello Jazzy", message: "This is just a custom alert to tell you how much Jazzy makes our lives easier") { (buttonTapped) in print("The ok button was tapped") }Declaration
Swift
static func present(_ viewController: UIViewController, title: String, message: String , actionHandler :@escaping(UIAlertAction) -> Void)Parameters
viewControllerView Controller over which the function is called. You can use self, or provide view controller name.
titleThis will display a title String.
messageThis will display a message String.
actionHandlerThis will give you call back inside block when OK button is tapped
AlertHandler Class Reference