0
ここに私のprint(childSnap)
が印刷されており、as? [String : Any]
と解析しようとしましたが、いつも失敗しました。firebase配列の解析は常に失敗しました
Snap (-Ki9GkBvIMofJiIByVeI) {
location = Cupertino;
name = "find hotel ";
userCreatedId = "";
}
let ref = FIRDatabase.database().reference()
let allGroup = ref.child("all-group")
allGroup.observe(.childAdded, with: { (snapshot) in
for childSnap in snapshot.children{
print(childSnap)
if let _childSnap = childSnap as? [String : Any] {
//this code not execute..
let group = Group(json: _childSnap)
groups.append(group)
}
}
}, withCancel: nil)
}