Skip to content

Instantly share code, notes, and snippets.

@isthisjoe
Created October 2, 2014 15:08
Show Gist options
  • Save isthisjoe/63e47c5b5ce91e9812a3 to your computer and use it in GitHub Desktop.
Save isthisjoe/63e47c5b5ce91e9812a3 to your computer and use it in GitHub Desktop.
:: UIAlertController ::
let alertController = UIAlertController(title: "Default Style", message: "A standard alert.", preferredStyle: .Alert)
let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel) { (action) in
// ...
}
alertController.addAction(cancelAction)
let destroyAction = UIAlertAction(title: "Destroy", style: .Destructive) { (action) in
println(action)
}
alertController.addAction(destroyAction)
let OKAction = UIAlertAction(title: "OK", style: .Default) { (action) in
// ...
}
alertController.addAction(OKAction)
self.presentViewController(alertController, animated: true) {
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment