Easy Swift UIAlertController
- One line setup for all UIAlertControllers
- Button action with closures instead of selectors
- Easily customizable
EZAlertController.alert("Title")
EZAlertController.alert("Title", message: "Message")
EZAlertController.alert("Title", message: "Message", acceptMessage: "OK") { () -> () in
print("cliked OK")
}
EZAlertController.alert("Title", message: "Message", cancelBlock:
{ () -> () in
print("clicked cancel")
}) { () -> () in
print("clicked accept")
}
EZAlertController.alert("Title", message: "Message", leftButtonMessage: "Cancel", rightButtonMessage: "Accept", leftBlock:
{ () -> () in
print("clicked cancel")
}) { () -> () in
print("clicked accept")
}
let alertController = EZAlertController.alert("My Title") // Returns UIAlertController
alertController.buttonCornerRadius = 20.0f;
alertController.view.tintColor = self.view.tintColor;
alertController.titleFont = UIFont(name: "AvenirNext-Bold", size: 19.0)
alertController.backgroundTapDismissalGestureEnabled = true
...
###Requirements
- Swift version 2.0
You can use Cocoapods to install EZAlertController
by adding it to your Podfile
:
platform :ios, '8.0'
use_frameworks!
pod 'EZAlertController'
- Download and drop 'EZAlertController.swift' in your project.
##Improvement
- Feel free sending pull requests.
##License
- EZAlertController is available under the MIT license. See the LICENSE file.
##Keywords swift, alert, AlertView, AlertViewController, UIAlertView, UIAlertViewController