Created
August 12, 2018 18:29
-
-
Save nishabe/f9d8c0095067047325ad7ba1e3ee1def to your computer and use it in GitHub Desktop.
SWIFT: AlertViewController
This file contains hidden or 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: "Alert Title", message: "Alert Message", preferredStyle: UIAlertControllerStyle.alert) | |
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in | |
switch action.style{ | |
case .default: | |
print("default") | |
case .cancel: | |
print("cancel") | |
case .destructive: | |
print("destructive") | |
}})) | |
self.present(alert, animated: true, completion: nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment