Guest User

Untitled

a guest
Sep 25th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. Database.database().reference().child("rooms").child(self.matchGameMode).child(self.matchGender).child(self.matchAge).observeSingleEvent(of: DataEventType.value) { (snapshot) in
  2. print("1")
  3. if let snapshot = snapshot.children.allObjects as? [DataSnapshot] {
  4. print("2")
  5. for snap in snapshot {
  6. print("3")
  7. if let postDict = snap.value as? [String: AnyObject] {
  8. print("4")
  9. let post = postDict
  10. self.rooms.insert(post as NSDictionary, at: 0)
  11.  
  12. print("OKay")
  13. print(self.matchGameMode)
  14. print(self.matchGender)
  15. print(self.matchAge)
  16. print("= Dictionary (self.rooms)")
  17. }
  18. }
  19. }
  20. }
  21. let when = DispatchTime.now() + 2
  22. DispatchQueue.main.asyncAfter(deadline: when, execute: {
  23. print("=== Dictionary (self.rooms)")
  24.  
  25. })
  26. }
Add Comment
Please, Sign In to add comment