GeoFire query on User location

后端 未结 3 1402
灰色年华
灰色年华 2020-12-09 13:57

I\'m quite new to work with Firebase and its location library, GeoFire. Currently I\'m facing some problem when structuring my data.

At the moment my db is something

3条回答
  •  不思量自难忘°
    2020-12-09 14:40

    To save all your records that match the query you have to store all of using something like:

        var allKeys = [String:CLLocation]()
    
        circleQuery.observeEventType(GFEventTypeKeyEntered, withBlock: {
            (key: String!, location: CLLocation!) in
    
            allKeys [key]=location
          }
    

    and then use

        circleQuery.observeReadyWithBlock({
            print("All initial data has been loaded and events have been fired!")
        })
    

提交回复
热议问题