This question already has an answer here:
- Pick a random element from an array 8 answers
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