CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

SwAlert 1.2.0

SwAlert 1.2.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Mar 2019
SPMSupports SPM

Maintained by airin.



SwAlert 1.2.0

  • By
  • Airin

SwAlert

Version License Swift 5.0 Platforms iOS Xcode 10.2

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

Requirements

  • Xcode 10.2+
OS Swift
v1.1.x iOS 9+ 4.0
v1.2.x iOS 10+ 5.0

Installation

use_frameworks!

pod "SwAlert"

License

MIT license. See the LICENSE file for more info.