Created
May 31, 2015 14:43
-
-
Save BradB132/b1bc810c3c8b5380adfb to your computer and use it in GitHub Desktop.
FirstAppInSwift-10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: .Alert /* or .ActionSheet*/) | |
alert.addAction(UIAlertAction(title: "OK", style: .Default, handler: { (action:UIAlertAction!) in | |
//this block runs when 'OK' is tapped | |
})) | |
alert.addAction(UIAlertAction(title: "Cancel", style: .Cancel, handler: { (action:UIAlertAction!) in | |
//this block runs when 'Cancel' is tapped | |
})) | |
//present this controller just like any other | |
self.presentViewController(alert, animated: true, completion: nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment