问题
last time my code worked fine as other member suggested. And somehow today, the error appear again. I keep checking but can't figure out how.
class AuthFirebase: NSObject {
//This is instance of FIRDatabase to read and write data from Firebase database
static let dataBase = Database.database().reference()
static var currentUserID:String = ""
static var currentUser: User? = nil
//Create Function to Log In
static func LogIn(email:String, password:String, completion: @escaping(_ success: Bool ) ->
Void) {
Auth.auth().signIn (withEmail: email, password: password, completion:{ (AuthDataResult,error) in
if let error = error {
print(error.localizedDescription)
completion(false)
}
else {
if let user = AuthDataResult?.user {
currentUser = user
currentUserID = user.uid
completion(true) }
}
}
)
}
}
来源:https://stackoverflow.com/questions/60143831/cannot-assign-value-of-type-user-to-type-user