mardi 2 août 2016

How to add actions to UIAlertController and get result of actions (Swift)

I want to set up four action buttons on my UIAlertController with a title for each and I want to return the title of the button that is pressed. In short, here is my plan:

Create a new alert controller
for i in ["hearts", "spades", "diamonds", "hearts"] {
    add action button to alert
    set title of button to i
}
return currentTitle() of action button that was clicked

Aucun commentaire:

Enregistrer un commentaire