Lawris Lawris - 3 months ago 28x
Swift Question

For each child in firebase

How can I list all the child in my firebase, so that I can count them and list each one on a table view ?

I've looked for the old documentation and the proposed code didn't worked.
I don't know if the new documentation is full or if there is something I can't see ?

Any help is appreciated.


With Firebase we have a snapshot with all the values from the database.

So, I first import the snapshot value as a Dictionary. Then, I use the count method.

        let mySnap = snapshot.value! as! [String:AnyObject]

        howManyDevices = mySnap.count

Simple as that.