SHARE
TWEET

Untitled

a guest Oct 12th, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private func fetchUser(withId uid: String) {
  2.  
  3.     FIRDatabase.database().reference().child("users").child(uid).observeSingleEvent(of: .value, with: { (snapshot) in
  4.  
  5.         if let dictionary = snapshot.value as? [String: AnyObject] {
  6.             let user = User()
  7.             user.name = dictionary["name"] as? String
  8.             user.profileImageUrl = dictionary["profileImageURL"] as? String
  9.             self.users.append(user)
  10.             self.attemptReloadOfCollection()
  11.         }
  12.     }, withCancel: nil)
  13. }
RAW Paste Data
Top