Latest 1.1.0
Homepage https://github.com/xxxAIRINxxx/SwAlert
License MIT
Platforms ios 9.0, requires ARC
Authors

Version
License
Swift 4.0
Platforms iOS
Xcode 9.1

Wrapper of UIAlertController. written in Swift.

Usage

Show No Action Alert


SwAlert.showAlert("no action title", message: "no action message", buttonTitle: "button title")

Show Simple Action Alert and CompletionHandler


SwAlert.showAlert("one action title", message: "no action message", buttonTitle: "button title") { result in
    println("showOneActionAlert completion")
}

Show Some Action Alert and CompletionHandler


SwAlert(title: "double action title", message: "double action message")
    .addAction("double action 1") { result in
        println("double action 1 completion")
    }
    .setCancelAction("cancel action") { result in
        println("cancel action completion")
    }
    .show()

Show Textfield Action Alert and CompletionHandler


SwAlert(title: "text action title", message: "text action message")
    .addTextField("text action 1 title", placeholder: "text action 1 placeholder")
    .addTextField("text action 2 title", placeholder: "text action 2 placeholder")
    .addAction("text action") { result in
        println(result) // Other(["text action 1 title", "text action 2 title"])
    }
    .show()

Objc Version

ARNAlert

Requirements

  • iOS 9.0+
  • Xcode 9.1+
  • Swift 4.0+
  • CocoaPods 1.3.0+

Installation

use_frameworks!

pod "SwAlert"

License

MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SwAlert",
    "version": "1.1.0",
    "summary": "Wrapper of UIAlertController. written in Swift.",
    "homepage": "https://github.com/xxxAIRINxxx/SwAlert",
    "license": "MIT",
    "authors": {
        "Airin": "[email protected]"
    },
    "source": {
        "git": "https://github.com/xxxAIRINxxx/SwAlert.git",
        "tag": "1.1.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source_files": "Sources/*.swift",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This