Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ref: DatabaseReference!
- tableView.delegate = self
- tableView.dataSource = self
- ref = Database.database().reference()
- var i : Int = -1
- ref.child(selectedNo!).observeSingleEvent(of: .value, with: { (snapshot) in
- for folder in snapshot.children {
- i += 1
- if let snap = folder as? DataSnapshot {
- let dic = snap.value as! NSDictionary
- self.elements.append(dic["image"] as! String)
- }
- }
- self.tableView.reloadData()
- }) { (error) in
- print(error.localizedDescription)
- }
Add Comment
Please, Sign In to add comment