AJAlertController
AJAlertController copied to clipboard
AJAlertController is a simple, customisable alert view written in Swift. It is well managed for working on all screens and devices supporting iOS 9.0 and later.
AJAlertController
AJAlertController is a simple, customizable alert view written in Swift. It is well managed for working on all screens and devices supporting iOS 9.0 and later.
Requirements
iOS 9.0+ and Swift 4 are required.
Installation
Just Drag and Drop AJAlertController
folder in your project.
Features
- [x] Easy to use anywhere, as it is added on topmost view controller.
- [x] Convenient alert view with title, message and buttons
- [x] Appears with transition animations
- [x] Easily customizable appearance, including fonts, colours, corner radius, shadow, overlay colour and blur, etc.
- [x] Can be dismissed on background tap.
- [x] Works on all screens and devices supporting iOS 9.0 and later.
Example
You can find this example in the project repo. To see it in action clone the repo and run the sample project.
/// Pass alert message, cancel button title, other button title
AJAlertController.initialization().showAlert(message: "This is Alert message with two buttons", cancelButton: "NO", otherButton: "YES") { (index, title) in
print(index,title)
}
/// Pass alert message
AJAlertController.initialization().showAlertWithOkButton(message: "This is normal alert message") { (index, title) in
print(index,title)
}
Usage
Initialization
AJAlertController.initialization()
Display an Alert
public func showAlert( message:String, cancelButton:String?, otherButton:String?, completion : alertCompletionBlock)
Display an Alert with OK Button
public func showAlertWithOkButton( message:String, completion : alertCompletionBlock)
License
AJAlertController
is available under the MIT license. See the LICENSE file for more info.
Author
For any queries and suggestions reach out at [email protected]