Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var user:String = (Auth.auth().currentUser?.email)! // I used email as name of document.
- var Groups = [String:Any]()
- let docRef = AppDelegate.db.collection("JoinedGroups").document(user)
- docRef.getDocument(source: .cache) { (document, error) in
- if let document = document {
- let dataDescription = document.data()
- self.Groups = dataDescription! // unwrapping here
- print("Cached document data: (dataDescription)")
- } else {
- print("Document does not exist in cache")
- }
- }
- // Do any additional setup after loading the view.
- print(Groups)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement