【发布时间】:2016-04-28 21:39:46
【问题描述】:
这里是 swift 和 Firebase 的初学者!我有一个看起来像这样的数据库:
数据库
玩家
ref.authdata.uid-for-player-1
ref.authdata.uid-for-player-2
ref.authdata.uid-for-player-3
教练
ref.authdata.uid-for-coach-1
ref.authdata.uid-for-coach-2
ref.authdata.uid-for-coach-3
我的应用有一半是为球员设计的,另一半是为教练设计的。
如何检查 ref.authData.uid 孩子是否在玩家或教练孩子之下?我的数据结构是否错误?
此外,每个 uid 下都有更多的孩子,我没有在我的图表中包含这些孩子,其中包含有关每个球员/教练的信息。以下是我用于初步构建的身份验证方法。
if ref.authData != nil {
print("There is already a user signed in!")
self.performSegueWithIdentifier("playerLogin", sender: self)
} else {
// No user is signed in
}
感谢您的帮助!
【问题讨论】:
标签: ios swift authentication firebase