SwiftAlert 0.1.13

SwiftAlert 0.1.13

Maintained by lyc2345.



SwiftAlert 0.1.13

  • By
  • Stan Liu

Alert

[![CI Status](http://img.shields.io/travis/Stan Liu/Alert.svg?style=flat)](https://travis-ci.org/Stan Liu/Alert) Version License Platform

Example

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.

Requirements

Installation

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()

Author

Stan Liu, [email protected]

License

Alert is available under the MIT license. See the LICENSE file for more info.