首页 > 解决方案 > FireStore Data getting and storing it in an array

问题描述

I am fetching data from Cloud Firestore and I don't know hot to get the name and imageURl from the data I fetched.

Here is the code:

func getFireBaseData(){
    db.collection("categories").getDocuments() { (querySnapshot, err) in
        if let err = err {
            print("Error getting documents: \(err.localizedDescription)")
        } else {

            for document in querySnapshot!.documents {

                self.categoryDictionary.append(document.data())
            }
            self.tableVu.reloadData()
        }
    }  
}

标签: iosiphoneswiftgoogle-cloud-firestore

解决方案


推荐阅读