My codes error I do not know why its saying that \'uid\' has no member, also i don\'t know where AuthDataResult is coming from because i have never used this as an import or
The error you get is:
Value of type
AuthDataResult
has no memberuid
If you look at the reference documentation for AuthDataResult, you'll see that this is correct: there is no uid
in that class. The uid
property exists in FIRUser
, so you'll want to use:
user?.user.uid
Or to make it less confusing, give your current user
variable a name that better matches what it is:
Auth.auth().signIn(withEmail: email, password: password) { (authData, error ) in
if error != nil{
//create account
} else {
KeychainWrapper.standard.set((authData?.user.uid)!,
forKey: ("Key_UID"))
self.preformSegue(performSegue(withIdentifier: "toFeed", sender: nil))
}
}