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

    viewController

    View Controller over which the function is called. You can use self, or provide view controller name.

    title

    This will display a title String.

    message

    This will display a message String.

    actionHandler

    This will give you call back inside block when OK button is tapped