samedi 21 avril 2018

How to get a random number only once in Xcode

I want to create an motivational App in Xcode. The motivation Sentences were randomly choosed with this code.

arc4random_uniform(100)

The problem: The code displays for example 2 and that another 2 so the User get's the same Sentence again.

I need something, that get's a random number from a range for example 100 only once and after every digit the code should repeat itself so that the user can see the Motivational sentences again.




Aucun commentaire:

Enregistrer un commentaire