Skip to content

Instantly share code, notes, and snippets.

@davut
Last active September 27, 2018 18:49
Show Gist options
  • Save davut/d6c23ec4e81d4e3d55eb243cd535fb6f to your computer and use it in GitHub Desktop.
Save davut/d6c23ec4e81d4e3d55eb243cd535fb6f to your computer and use it in GitHub Desktop.
class MyAlertController {
func showAlert(on vc: UIViewController, withTitle title: String, message: String, actionTitle: String) {
let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert)
let action = UIAlertAction(title: actionTitle, style: .default, handler: nil)
alertController.addAction(action)
vc.present(alertController, animated: true, completion: nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment