I would like to make an alert type box so that when the user tries to delete something, it says, \"are you sure\" and then has a yes or no for if they are sure. What would b
Being that UIAlertView is now deprecated, I wanted to provide an answer to future coders that come across this.
Instead of UIAlertView, I would use UIAlertController like so:
@IBAction func showAlert(_ sender: Any) {
let alert = UIAlertController(title: "My Alert", message: "This is my alert", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.default, handler: {(action) in
alert.dismiss(animated: true, completion: nil)
}))
self.present(alert,animated:true, completion:nil)
}