Tell me who faced, how can I get to the child node (I hope I correctly called it) in the firebase? The structure of the firebase branch is as follows: enter image description here

I need to get to the "Photo" node and then upload these images to the cells in collectionView.

    1 answer 1

    I will answer myself, can someone come in handy.

    A slightly different example, but the essence is the same firebase structure:

    posts post_0 Photo image: "https://www....." post_1 Photo image: "https://www....." 

    Swift code:

     let ref = self.ref.child("posts") ref.observeSingleEvent(of: .value, with: { snapshot in for child in snapshot.children { let snap = child as! DataSnapshot let imageSnap = snap.childSnapshot(forPath: "Photo") let dict = imageSnap.value as! [String: Any] let url = dict["image"] as! String print(url) } })