lundi 9 mars 2015

How can I make various strings and shuffle them randomly


@IBAction func buttonTapped() {
//I figured out how to put random numbers but I want to put random words that I write
var randomText = String(arc4random_uniform(5))

textLabel.setText(randomText)
}


Basically instead of having random numbers being displayed when button is tapped, I want random numbers to display. For example ["yes", "no", maybe"] randomly appearing instead of numbers 0-5.


How would I do this?





Aucun commentaire:

Enregistrer un commentaire