Skip to content

Instantly share code, notes, and snippets.

@pietrorea
Last active November 27, 2016 19:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pietrorea/8c0763ea1f7a3caf2393 to your computer and use it in GitHub Desktop.
Save pietrorea/8c0763ea1f7a3caf2393 to your computer and use it in GitHub Desktop.
UIAlertController example
var alert = UIAlertController(title: "Title", message: "Alert view message", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Save", style: .Default, handler: { (action: UIAlertAction!) in
println("Saved")
}))
alert.addAction(UIAlertAction(title: "Cancel", style: .Default, handler: { (action: UIAlertAction!) in
println("Cancel")
}))
presentViewController(alert, animated: true, completion: nil)
@kiritmodi2702
Copy link

good one, see more alertview using UIAlertController in Swift : http://iosdevcenters.blogspot.com/2016/03/uialertcontroller-in-swift.html

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