So I’m trying to make a game with XCode 12. However, comma, I can’t figure out how to get an extra button on that alert. Just so you know, I need it to be a destructive button. Can anybody help me out here?
Hi,
You just need to add another alertAction like this:
let secondAction:UIAlertAction = UIAlertAction(title: "Yes, Delete ALL", style: UIAlertAction.Style.destructive) { (myAlert) in
//your delete code goes here
}
And then don’t forget to add the action before you call present"
alert.addAction(secondAction)
That’s it.
Blessings,
—Mark