imperiumlabs / GeoFirestore-iOS

GeoFirestore for iOS - Realtime location queries with Firestore
MIT License
127 stars 46 forks source link

How can I bind GeoQueries to UITableView with FirebaseUI? #10

Open yigitserin opened 5 years ago

yigitserin commented 5 years ago

This is how I currently bind my normal queries to UITableView with FirebaseUI library. Is there any way I can use GeoQueries here?

var dataSource: FUIFirestoreTableViewDataSource!
var query: Query = Firestore.firestore().collection("posts")

dataSource = tableView.bind(toFirestoreQuery: query) { (tableView, indexPath, snapshot) -> UITableViewCell in

            //Get Post
            var snapshotData = snapshot.data()!
            snapshotData["documentID"] = snapshot.documentID
            let post = try! FirebaseDecoder().decode(Post.self, from: snapshotData)

            return self.cellForRow(tableView: tableView, indexPath: indexPath, post: post)
        }