Snippets Collections
func getDataFromFireStore() {
        print("getting data")
        let activityView = activityIndicatorView()
        activityView.startAnimating()
        let db = Firestore.firestore()
        db.collection("Activities").getDocuments() { (querySnapshot, error) in
            if error != nil {
                print("Error getting documents: \(error!)")
            } else {
                self.activitiesArray.removeAll()
                for document in querySnapshot!.documents {
                    print("for loop")
                    let activities = ActivitiesModel()
                    let data = document.data()
                    activities.title = data["title"] as! String
                    activities.description = data["description"] as! String
                    activities.image_url = data["image_url"] as! String
                    self.activitiesArray.append(activities)
                }
                activityView.stopAnimating()
                self.activitiesTableView.reloadData()
            }
        }
        
    }

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension