[英]Retrieve nested data from firebase using Swift
我如何访问嵌套的网站 url。 我也不知道如何访问 Medium 部分下的 img。 我可以通过提供的图像中的代码访问其他信息,没有问题:
ref = Database.database().reference()
ref.child("artists").queryOrderedByKey().observe(.value) { snapshot in
var temp = [Artist]()
for child in snapshot.children {
if let child = child as? DataSnapshot {
// decode json into Artist Struct
let model = try! FirestoreDecoder().decode(Artist.self, from: child.value as! [String : Any])
temp.append(model)
// print(model)
}
}
Let ref = Database().database.refrence()
ref.child("TopNode").child("secondInerNode").observe(.value, with: {//stuff})
你写下你有数据的地方的路径,然后观察。
TopNode
secondInerNode
name: value;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.