我在从swift到firebase的查询中遇到问题。波纹管是火力点我的样本JSON:添加数据并从swift查询到firebase
Lulibvi-D220
Contas
-KwlPQZTqVfNhHAsFyW5
Nome: "Assets"
Numero: "1"
-KwlGJLUTqVfnhYHAsFyW5
Nome: "Liabilities"
Numero: "2"
我的代码如下:
let nome: String = "Liabilities"
let numero: String = "2"
ref = Database.database().reference()
ref.child("Contas").child("Assets").observeSingleEvent(of: .value) { (snapshot) in
let numero = (snapshot.value as? NSDictionary)?["Numero"] as? String
print (numero as Any)
}
调试时,调试器只是跳转所有的代码(快照)在后并没有执行它。
我做错了什么?
感谢
大......这工作!非常感谢完整的解释 –