2016-12-17 68 views
1

我是初學者使用Swift 3 我收到錯誤:無法轉換類型' FIRUser,_) - >()'爲'FIRAuthResultCallBack?'的期望參數類型。無法將類型'(FIRUser,_) - >()'的值轉換爲'FIRAuthResultCallBack'的預期參數類型錯誤

什麼是這個錯誤,我該如何解決它?

func handleRegister() { 

    guard let email = emailTextfield.text, let password = passwordTextfield.text else{ 
     print("Invalid Entry to Form") 
     return 
    } 

    FIRAuth.auth()?.createUser(withEmail: email, password: password, completion: {(user: FIRUser, error) in 

     if error != nil { 
      print(123456) 
      return 
     } 
    }) 
} 

回答

1

請與替換代碼:

FIRAuth.auth()?.createUser(withEmail: email, password: password, completion: { (user, err) in 
     if error != nil 
     { 
      print(123456) 
      return 
     } 
}) 
+0

你救了我的命 – Michaelcode

相關問題