Ryan Ryan - 1 year ago 61
Swift Question

Ambigious use of 'Key'

I am trying to print the Key name of a piece of data from Firebase using swift but I keep getting 'Ambigious use of Key' when I type something like:

for child in snapshot.children{

How can I avoid this? All help is appreciated very much!

Answer Source

Cast it as FIRDataSnapshot. Try doing this:

for child in snapshot.children{
 let child1 = child as! FIRDataSnapshot
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download