Last active
November 20, 2018 06:35
-
-
Save vasilevkin/f58ca7a101a69f29b029c158606a64f0 to your computer and use it in GitHub Desktop.
Just a boiler plate code to display simple alert in Swift.
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: "Simple Title", | |
message: "Alert message", | |
preferredStyle: .alert) | |
let okAction = UIAlertAction(title: "Close", style: .default) | |
alert.addAction(okAction) | |
DispatchQueue.main.async { | |
UIApplication.topViewController()?.present(alert, animated: true, completion: nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment