Skip to content

Instantly share code, notes, and snippets.

@marcos1262
Last active October 27, 2018 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcos1262/059fd7ea4aacceda6d9327fa85bf983a to your computer and use it in GitHub Desktop.
Save marcos1262/059fd7ea4aacceda6d9327fa85bf983a to your computer and use it in GitHub Desktop.
Error alert
extension UIViewController {
func showError(_ message: String?) {
let alert = UIAlertController(title: "Error", message: message, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
self.present(alert, animated: true, completion: nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment