这是错误无法转换类型'字符串预期参数类型'用户'的值 var用户:用户? fileprivate func fetchUser(){
let uid = user ?? (Auth.auth().currentUser?.uid ?? "")
// guard let uid = Auth.auth().currentUser?.uid else { return }
Database.fetchUserWithUID(uid: uid) { (user) in
self.user = user
self.navigationItem.title = self.user?.username
self.collectionView?.reloadData()
self.paginatePosts()
}
}
答案 0 :(得分:1)
Auth.auth().signInAndRetrieveData(with: credential) { (authResult, error) in
if let error = error {
// ...
return
}
let uuid = Auth.auth().currentUser!.uid
}
尝试这个。它可能会解决您的问题
答案 1 :(得分:0)