Skip to content

Instantly share code, notes, and snippets.

@tucan9389
Created May 31, 2018 11:01
Show Gist options
  • Save tucan9389/fbcba6011634ed24b0ea35f66cbfd908 to your computer and use it in GitHub Desktop.
Save tucan9389/fbcba6011634ed24b0ea35f66cbfd908 to your computer and use it in GitHub Desktop.
Useful UIViewController extenstion for simple alert call with just message: String? parameter.
extension UIViewController {
func showSimpleAlert(message: String?) {
let alert = UIAlertController(title: "Note", 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