- August 28, 2025
- Mins Read
KRAlertController is a beautiful and easy-to-use alert controller for your iOS written by Swift.
To run the example project, clone the repo, and open KRAlertControllerDemo.xcodeproj from the DEMO directory.
or appetize.io
KRAlertController is available through CocoaPods and Carthage. To install it, simply add the following line to your Podfile or Cartfile:
# Podfile
pod “KRAlertController”
# Cartfile
github “Krimpedance/KRAlertController”
(see sample Xcode project in /Demo)
Mainly the same as UIAlertController.
At first, import KRAlertController in your swift file.
Show simple alert.
KRAlertController(title: “Title”, message: “message”)
.addCancel()
.addAction(“OK”) { action, textFields in
print(“OK”)
}
.show()
init(title: String?, message: String?, style: KRAlertControllerStyle = .Alert)
There is 7 kinds of alert. icon pass true to display glaph icon; otherwise, pass false. Default view controller to display alert is visible view controller of key window.
func show(presentingVC: UIViewController? = nil, animated: Bool = true, completion: (() -> ())? = nil)
func showSuccess(icon icon: Bool, presentingVC: UIViewController? = nil, animated: Bool = true, completion: (() -> ())? = nil)
func showInformation(icon icon: Bool, presentingVC: UIViewController? = nil, animated: Bool = true, completion: (() -> ())? = nil)
func showWarning(icon icon: Bool, presentingVC: UIViewController? = nil, animated: Bool = true, completion: (() -> ())? = nil)
func showError(icon icon: Bool, presentingVC: UIViewController? = nil, animated: Bool = true, completion: (() -> ())? = nil)
func showEdit(icon icon: Bool, presentingVC: UIViewController? = nil, animated: Bool = true, completion: (() -> ())? = nil)
func showAuthorize(icon icon: Bool, presentingVC: UIViewController? = nil, animated: Bool = true, completion: (() -> ())? = nil)
// Example
alert.showSuccess(true)
alert.showWarning(true, presentingVC: self, animated: false) {
print(“Showed warning alert!”)
}
3.1.0
3.0.1
3.0.0
This package provides you with an easy way to show tooltips over any SwiftUI view, since Apple does not provide ...
SimpleToast is a simple, lightweight, flexible and easy to use library to show toasts / popup notifications inside iOS or ...
Create Toast Views with Minimal Effort in SwiftUI Using SSToastMessage. SSToastMessage enables you to effortlessly add toast notifications, alerts, and ...