Skip to content

Instantly share code, notes, and snippets.

@jlyonsmith
Forked from pietrorea/UIAlertController.swift
Last active November 27, 2016 19:09
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 jlyonsmith/5f28d1722866fac0ce78372d190c94e8 to your computer and use it in GitHub Desktop.
Save jlyonsmith/5f28d1722866fac0ce78372d190c94e8 to your computer and use it in GitHub Desktop.
UIAlertController example
let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Save", style: .default, handler: { (action: UIAlertAction!) in
debugPrint("Saved")
}))
alert.addAction(UIAlertAction(title: "Cancel", style: .default, handler: { (action: UIAlertAction!) in
debugPrint("Cancel")
}))
present(alert, animated: true, completion: nil)
@jlyonsmith
Copy link
Author

Updated for Swift 3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment