mirror of
https://github.com/lil-org/tokenary.git
synced 2024-11-30 03:04:17 +03:00
Add optional completion to message alert
This commit is contained in:
parent
655957e194
commit
2829ee470d
@ -14,9 +14,11 @@ extension UIViewController {
|
||||
dismiss(animated: true)
|
||||
}
|
||||
|
||||
func showMessageAlert(text: String) {
|
||||
func showMessageAlert(text: String, completion: (() -> Void)? = nil) {
|
||||
let alert = UIAlertController(title: text, message: nil, preferredStyle: .alert)
|
||||
let okAction = UIAlertAction.init(title: Strings.ok, style: .default)
|
||||
let okAction = UIAlertAction(title: Strings.ok, style: .default) { _ in
|
||||
completion?()
|
||||
}
|
||||
alert.addAction(okAction)
|
||||
present(alert, animated: true)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user