Skip to content

Instantly share code, notes, and snippets.

@jimbrayrcp
Created May 6, 2020 16:10
Show Gist options
  • Save jimbrayrcp/d8e1abca13dc939e5da1bee4bb457ff1 to your computer and use it in GitHub Desktop.
Save jimbrayrcp/d8e1abca13dc939e5da1bee4bb457ff1 to your computer and use it in GitHub Desktop.
Swift 5: iOS: 13.1 Insert into any method for an alert
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)
@jimbrayrcp
Copy link
Author

For the Action Sheet Type of alert
LINK TO ACTION SHEET

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