Latest 0.1
Homepage https://github.com/DingHub/ChainableAlert
License MIT
Platforms ios 8.0, requires ARC
Authors

Chainable usage of Alert.

We have a helper named ChainableAlert, and an extension of UIViewController to add chainable usage of alert.
If the device is below iOS 8, UIAlertView or UIActionSheet will be used, else, UIAlertController will be used.
Usage:

in view controller:

self.actionSheet("Title", message: "message")
 .normalButton("normal1")
 .normalButton("normal2")
 .normalButton("normal3") {
    print("normal3")
 }
 .destructiveButton("destructive1") {
    print("destructive1")
 }
 .destructiveButton("destructive2")
 .cancleButton("cancle")
 .show(animated: true)

or

 ChainableAlert
 .alert("Title", message: "message")
 .normalButton("normal1")
 .normalButton("normal2")
 .normalButton("normal3") {
    print("normal3")
 }
 .destructiveButton("destructive1") {
    print("destructive1")
 }
 .destructiveButton("destructive2")
 .cancleButton("cancle") {
    print("canceled")
 }
 .show(animated: true) {
    print("showd!")
 }

You can find an Objective-C version HERE

Latest podspec

{
    "name": "ChainableAlert",
    "version": "0.1",
    "license": "MIT",
    "summary": "Chainable use of Alert.",
    "homepage": "https://github.com/DingHub/ChainableAlert",
    "authors": {
        "DingHub": "[email protected]"
    },
    "source": {
        "git": "https://github.com/DingHub/ChainableAlert.git",
        "tag": "0.1"
    },
    "source_files": "Source/*.{Swift}",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true
}

Pin It on Pinterest

Share This