Created
May 6, 2020 16:04
-
-
Save jimbrayrcp/b3aef21e329578d5dc1e171c22fa54f1 to your computer and use it in GitHub Desktop.
Swift 5: iOS: 13.1 Insert into any method for an action sheet alert type
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: .actionSheet) | |
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 alert type:
LINK FOR SWIFT ALERT