简体   繁体   English

使用FIRAuth实施创建用户时遇到问题

[英]Having problems implementing Create User with FIRAuth

I've ran into this issue and have been trying to solve it for a few days now and it seems everything I try it creates more errors. 我遇到了这个问题,并且已经尝试解决了几天,似乎我尝试解决的所有问题都会产生更多错误。 I'm having problems creating a user with this function use FIRAuth and its telling me to add in a ; 我在使用FIRAuth创建该功能的用户时遇到问题,它告诉我添加一个; right before in, but it doesn't fix the problem. 就在之前,但这并不能解决问题。

Picture of Errors: 错误图片:

错误图片

func handleRegistration() {
        guard let email = emailTextField.text, let password = passTextField.text
            else {
                print("Form is not Valid")
                return
        }



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

         if error != nil {
            print("Error")
            return
        }

        print("Login Successful")
    }

Try this :- 尝试这个 :-

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

     if error != nil {
        print("Error")
        return
    }else{
        print("Login Successful")
        return 
   }
})

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM