Reputation: 145
I have alert view using this code:
func alert() {
let alert = UIAlertController(title: "Time Is Up",
message: "Either your company has Sold or had to Fold! (Click the button below to see)",
preferredStyle: .alert)
let action = UIAlertAction(title: "Next", style: .default) { _ in
self.performSegue(withIdentifier: "congratsSegue", sender: nil)
}
alert.addAction(action)
self.present(alert, animated: true, completion: nil)
}
I want to then turn this alert off when the done button pressed:
@IBAction func donePressed() {
}
Is this possible to do in Swift?
Upvotes: 0
Views: 478
Reputation: 407
self.dismiss(animated: true, completion: nil)
I don't think you would want to do that, but you could I suppose. self
here is the viewController.
Upvotes: 1