Converting to Swift 3 (Swift and Firebase Project)

I have just updated my Xcode to Xcode8 and I have converted the project to swift 3.

In signIn function here:

  • Firebase + swift retrieving user data
  • query & where in Firebase (swift 3)
  • Firebase Storage bucket issue ios Swift
  • Firebase: Cannot upload production APNs certificate
  • Observer's completion handler not called, how to check in code
  • Asynchronous loading - UITableView and Firebase
  •   Firth. Auth()?.signIn(withEmail: self.EmailTF.text!, password: self.PasswordTF.text!, completion: { (user: FIRUser?, error: NSError?) in
                            if let error = error {
                                print(error.localizedDescription)
                            } else {
    
                               self.ref.child("UserProfile").child(user!.uid).setValue([
                                    "email": self.EmailTF.text!,
                                    "name" : self.NameTF.text!,
                                    "phone": self.PhoneTF.text!,
                                    "city" : self.CityTF.text!,
                                    ])
                                print("Sucess")
    
                            }
                        })
    

    I’m getting this error:

    cannot convert value of type '(FIRUser?, NSError?) -> ()' to expected argument type 'FIRAuthResultCallback?'
    

    What’s the replacement of it in swift 3?

    Solutions Collect From Internet About “Converting to Swift 3 (Swift and Firebase Project)”

    Just replace it with :-

     FIRAuth.auth()?.signIn(withEmail:self.EmailTF.text!, password: self.PasswordTF.text!, completion: { (user, err) in
           if let error = err {
                            print(error.localizedDescription)
                        } else {
    
                           self.ref.child("UserProfile").child(user!.uid).setValue([
                                "email": self.EmailTF.text!,
                                "name" : self.NameTF.text!,
                                "phone": self.PhoneTF.text!,
                                "city" : self.CityTF.text!,
                                ])
                            print("Sucess")
    
                        }
        })