在下面的代码中,类型'String'的值没有成员'uid'
var userID: String!
if let email = emailField.text, let password = passwordField.text {
Auth.auth().signIn(withEmail: email, password: password) { (authData, error)
in
if error != nil {
//create account
} else {
if let userID = userID?.uid {
KeychainWrapper.standard.set((userID)!, forKey: ("uid"))
self.performSegue(withIdentifier: "toFeed", sender: nil)
}
}
}
}
答案 0 :(得分:0)
我认为您正在这样做:
if let userID = authData?.user.uid {