arrays - How to query multiple keys with Firebase GeoFire using Swift? -


i've got geofire query bringing user id's or keys. i'm getting keys in sequence, i'm getting several sequences. how can last updated sequence?

@ibaction func friendsnearmeactn(sender: anyobject)     {         let geofireref = self.ref.child("userlocations")         let geofire = geofire(firebaseref: geofireref)         let circlequery = geofire.queryatlocation(self.location, withradius: 20.6)         circlequery.observeeventtype(.keyentered, withblock: { (key: string!, location: cllocation!) in             self.localusers.append(key)             self.getlocalusers()         })     }  func getlocalusers() {     print(self.localusers)  } 

this i'm getting func getlocalusers()....

["wgueyzdjh4nw2vnehoygmjf6pyb3"] ["wgueyzdjh4nw2vnehoygmjf6pyb3", "cg4pqj36ttnuuwnqtc16tifmi0a2"] ["wgueyzdjh4nw2vnehoygmjf6pyb3", "cg4pqj36ttnuuwnqtc16tifmi0a2", "n5pgqgehw2f7pggvmb3aq8v1upk2"] 

how can last array?

the answer geofire query continuous asynchronous call , needs final code observereadywithblock feed self.localusers() collected information only. here example...

let regionquery = geofire.querywithregion(self.region)         regionquery.observeeventtype(.keyentered,  withblock: { (key: string!, location: cllocation!) in             var users = [string]()             users.append(key)             keys in users             {                 let user = keys                 allkeys.append(user)             }             self.localusers = allkeys             self.getlocalusers()         })          regionquery.observereadywithblock({ () -> void in             self.getlocalusers()         }) 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -