Skip to content

Instantly share code, notes, and snippets.

@jimbrayrcp
Created May 6, 2020 16:04
Show Gist options
  • Save jimbrayrcp/b3aef21e329578d5dc1e171c22fa54f1 to your computer and use it in GitHub Desktop.
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
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)
@jimbrayrcp
Copy link
Author

For the alert type:
LINK FOR SWIFT ALERT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment