【问题标题】:Using Firebase to create a collaborative TableView list使用 Firebase 创建协作 TableView 列表
【发布时间】:2018-07-19 09:08:14
【问题描述】:

我的想法是在 Firebase 中创建一些非常简单的练习,我想创建一个带有几个视图的简单应用程序:一个“主页”/启动屏幕,它导航到几个不同的视图:

  • 一个“朋友”列表,用户可以在其中添加其他用户并监控他们的在线/离线状态以及向他们发送所选群组的邀请

  • “邀请”屏幕监控传入邀请

  • 用户可以在其中创建、删除和选择组的“组”列表

  • 最后是所选组成员之间共享的协作列表。

快速用例:

  1. 用户“User1”打开应用程序并创建组“TestGroup”并单击它以将其选为活动组

  2. 然后用户进入好友界面,在这里他们添加好友“User2”并在列表中点击他们的名字,弹出欠费要求他们确认是否要邀请“User2”加入活跃组“TestGroup” "

  3. “User2”在他的“邀请”屏幕上找到一个邀请,他点击接受

  4. 现在“User1”和“User2”都可以读取和写入前面提到的协作 TableView 列表,该列表会根据活动/选择的“组”而变化。

这是可能的吗?我已经阅读了一些关于基本 Firebase 设置的教程,如下所示:https://www.raywenderlich.com/187417/firebase-tutorial-getting-started-3 非常适合我的需求,但我不知道从哪里开始了解“协作”列表。

【问题讨论】:

    标签: ios swift firebase


    【解决方案1】:

    是的,这是可能的。结构可以是这样的:

    -MembersForGroups  //here you have the groups and the members that are on each group, so when the user chooses a group the members are easily displayed
      --Group1ID
        ---member1ID:true  //when the user creates a group, the groupID is create and their user id is automatially added as member
        ---member2ID:true
    
    -Colabsheets //here you have all the colab sheets with each group containing the posts that users have made.
      --Group1ID // Give the sheet the same ID as the group so when you choose a group you can easily load the colab sheet.
        ---Post1
                senderid:""
                message:""
                timestamp:""
        ---Post2 ....
    

    【讨论】:

    • 非常有趣,谢谢!我对 Firebase 还没有非常直观的了解,所以我不太确定如何实现您提到的内容,但我会在进行过程中尝试弄清楚,非常感谢。
    • 我在我的答案中添加了一些 cmets 以使其更加清晰,如果您还不了解 Firebase,请阅读文档,练习,一切都会有意义。如果我的回答对您有帮助,请考虑接受/支持它。
    • 谢谢!我已经投票了,但由于我的代表人数少于 15,因此我的投票不会公开显示(“感谢您的反馈!声望少于 15 人的投票会被记录下来,但不要更改公开显示的帖子分数。” )
    • 是的,直到你有 15 个代表,你才能接受答案(你的问题的每个答案旁边的复选标记。祝你的项目好运。
    猜你喜欢
    • 2012-06-17
    • 2015-03-06
    • 2021-08-21
    • 2021-08-28
    • 1970-01-01
    • 1970-01-01
    • 2016-07-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多