-
-
Save geosava/f9b6cee41b1ef7c128cb to your computer and use it in GitHub Desktop.
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
// Declaring UIAlertController | |
var alert = UIAlertController(title: "Welcome!", message: "You logged in!", preferredStyle: UIAlertControllerStyle.Alert) | |
alert.addAction(UIAlertAction(title: "Continue", style: UIAlertActionStyle.Default, handler: nil)) | |
self.presentViewController(alert, animated: true, completion: nil) | |
// Handling UIAlertController Actions | |
alert.addAction(UIAlertAction(title: "Ok", style: .Default, handler: { action in | |
switch action.style{ | |
case .Default: | |
println("default") | |
break | |
case .Cancel: | |
println("cancel") | |
break | |
case .Destructive: | |
println("destructive") | |
break | |
} | |
})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment