Skip to content

lyc2345/Alert

Repository files navigation

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, lyc2345@gmail.com

License

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published