[](https://travis-ci.org/Stan Liu/Alert)
To run the example project, clone the repo, and run pod install
from the Example directory first.
Beware the storyboard in example uses UIStackView, So it can just runs on above iOS 9.0 device and simulator. But Alert uses Swift 3.0 can run on above iOS 8 device and simulator.
Alert is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Alert', :git => 'https://github.com/lyc2345/alert.git'
Usage:
Import Alert
To add a Button to UIAlertController
Alert.with(title: "Title", message: "Message", style: .alert).bind(button: "Button", style:
.default, completion: {
(action1) in
)}
then add a Textfield to UIAlertController
Alert.with(title: "Title", message: "Message", style: .alert).bind(button: "Button", style:
.default, completion: {
(action1) in
)}.bind(textfield: "Title", placeHolder: "PlaceHolder", secure: false, returnHandler: {
(textfield1) in
})
then present this UIAlertController
Alert.with(title: "Title", message: "Message", style: .alert).bind(button: "Button", style:
.default, completion: {
(action1) in
)}.bind(textfield: "Title", placeHolder: "PlaceHolder", secure: false, returnHandler: {
(textfield1) in
}).show()
Stan Liu, lyc2345@gmail.com
Alert is available under the MIT license. See the LICENSE file for more info.