samedi 27 août 2016

Selecting a random item from an array in Swift [duplicate]

This question already has an answer here:

I am a beginner Swift programmer and I am trying to do my best to figure out. I will have a bunch of users in my database with properties like username,password,etc.. and one of them is online/offline value. As far as I understand you cannot select a random item, you can only generate random numbers. I want to select a random user's uid from an array of users with "online" value. Are there any ways to do this? Thanks for your help.




Aucun commentaire:

Enregistrer un commentaire