extension UIViewController { func alert(title: String, message: String) { let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) let alertAction = UIAlertAction(title: "OK", style: .default, handler: nil) alertController.addAction(alertAction) self.present(alertController, animated: true, completion: nil) } func alert(title: String) { alert(title: title, message: "") } }