【问题标题】:Automatically Inserting Into A Table View in Swift [closed]在 Swift 中自动插入表格视图 [关闭]
【发布时间】:2020-08-17 08:23:14
【问题描述】:

我想将数据自动插入 Xcode 中的表格视图单元格,以便它从我的 Firestore 数据库中获取数据并插入到单元格中。我有两个问题:

1) 这可能吗?如果可以,我该怎么做? 2)如果我想使用像监听器这样的东西,它会实时更新,我该怎么做?

非常感谢!

【问题讨论】:

  • firebase 还是 firestore?您是否查看了 addSnapshotListener?如果您查找的话,会有很多材料
  • 我正在使用 Cloud Firestore 数据库。

标签: swift xcode firebase firebase-realtime-database google-cloud-firestore


【解决方案1】:

如果你正在为 IOS 13+ 开发,你可以尝试使用 combine 来检查这个链接:

http://trycombine.com/posts/combinedatasources-simple-static-list/

此外,如果有一个名为 RxSwift 的框架,您可以根据 Firebase 实时数据的收入创建反应式代码。你可以在这里查看:

https://github.com/ReactiveX/RxSwift

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-09-29
    • 1970-01-01
    • 2017-12-15
    • 2015-07-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多