Created
May 6, 2020 16:10
-
-
Save jimbrayrcp/d8e1abca13dc939e5da1bee4bb457ff1 to your computer and use it in GitHub Desktop.
Swift 5: iOS: 13.1 Insert into any method for an alert
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 alertTitle = "Test" | |
let alertMessage = "Test Message" | |
let alert = UIAlertController(title: alertTitle, message: alertMessage, preferredStyle: .alert) | |
alert.addAction(UIAlertAction(title: "Yes", style: .default, handler: { action in | |
// Add Actions to this closure | |
print("Test Response") | |
})) | |
alert.addAction(UIAlertAction(title: "No", style: .cancel, handler: nil)) | |
self.present(alert, animated: true) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For the Action Sheet Type of alert
LINK TO ACTION SHEET