Wrapper of UIAlertController. written in Swift.
SwAlert.showAlert("no action title", message: "no action message", buttonTitle: "button title")
SwAlert.showAlert("one action title", message: "no action message", buttonTitle: "button title") { result in
println("showOneActionAlert completion")
}
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()
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()
- Xcode 10.2+
OS | Swift | |
---|---|---|
v1.1.x | iOS 9+ | 4.0 |
v1.2.x | iOS 10+ | 5.0 |
use_frameworks!
pod "SwAlert"
MIT license. See the LICENSE file for more info.