Cleanup the alert func in utils
This commit is contained in:
parent
1ab70cf6d7
commit
38096f3f93
3 changed files with 6 additions and 22 deletions
|
|
@ -85,5 +85,11 @@ public class Utils {
|
|||
SharedDefaults[.passwordGeneratorFlavor] = "Random"
|
||||
}
|
||||
}
|
||||
|
||||
public static func alert(title: String, message: String, controller: UIViewController, handler: ((UIAlertAction) -> Void)? = nil, completion: (() -> Void)? = nil) {
|
||||
let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert)
|
||||
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: handler))
|
||||
controller.present(alert, animated: true, completion: completion)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue