使用Swift

时间:2019-03-15 22:36:38

标签: ios swift firebase firebase-realtime-database

我如何访问嵌套的网站网址。我也也不知道如何在“中等”部分下访问img。我可以通过提供的图片中的代码访问其他信息,没问题:

What my firebase looks like

What my code looks like

    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)

            }
        }

1 个答案:

答案 0 :(得分:0)

Let ref = Database().database.refrence()

ref.child("TopNode").child("secondInerNode").observe(.value, with: {//stuff})

您将路径写入具有数据的位置,然后进行观察。

TopNode
   secondInerNode
      name: value;

Check the docs for more info.

相关问题