Skip to content

emraz/ERAlertController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ERAlertController

  • Very simple alert controller fo swift 3.0 or above
  • Compitable with UIWindowScene
  • Compitable for Swift 5.0, iOS 11.3.X or above

How To Use

  1. To show only Alert

     ERAlertController.showAlert("Alert!", message: "ERAlertController with title and message", isCancel: false, okButtonTitle: "OK", cancelButtonTitle: "", completion: nil)
    
  2. To use button press action and custom title of the Alert controller button

     ERAlertController.showAlert("Alert!", message: "ERAlertController with button action", isCancel: true, okButtonTitle: "OK", cancelButtonTitle: "Cancel") { (isOK) in
         
         if(isOK) {
             print("OK button pressed")
         }
         else {
             print("Cancel button pressed")
         }
     }
    
  3. To show alert with input text field

    ERAlertController.showAlertWithTextInput(title: "Input Field",
                                             subtitle: "Please input your desire text",
                                             actionTitle: "Confirm",
                                             cancelTitle: "Discard",
                                             inputPlaceholder: "Please type...",
                                             inputKeyboardType: UIKeyboardType.default) { (alertAction) in
    } actionHandler: { (inputText) in
    }
    

About

Swift Alert Controller

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages