Skip to content

Instantly share code, notes, and snippets.

@JFSene
Created May 25, 2017 13:53
Show Gist options
  • Save JFSene/55824208c482edf169f11ff21564c5ec to your computer and use it in GitHub Desktop.
Save JFSene/55824208c482edf169f11ff21564c5ec to your computer and use it in GitHub Desktop.
static func alertMessage(errorMessage: String, controller: UIViewController, title: String) {
let alertController = UIAlertController(title: title, message: errorMessage, preferredStyle: .alert)
let okAction = UIAlertAction(title: "Ok", style: .default, handler: nil)
alertController.addAction(okAction)
controller.present(alertController, animated: true, completion: nil)
}
static func alertMessageNav(errorMessage: String, controller: UIViewController, title: String, cHandler: @escaping (Void)-> () ) {
let alertController = UIAlertController(title: title, message: errorMessage, preferredStyle: .alert)
let okAction = UIAlertAction(title: "Ok", style: .default, handler: {(action:UIAlertAction) in
cHandler()
})
alertController.addAction(okAction)
controller.present(alertController, animated: true, completion: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment