2

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 ; right before in, but it doesn't fix the problem.

Picture of Errors:

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")
    }
2
  • Instead of adding screenshots of your code, please add the actual code to the question. To capture the error message, right click on the red indicator and "Reveal in Issue Navigator". Commented Oct 5, 2016 at 15:27
  • you should watch this developer.apple.com/library/content/documentation/Swift/…, explain how closures work, @Dravidian is right Commented Oct 5, 2016 at 15:38

1 Answer 1

4

Try this :-

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

     if error != nil {
        print("Error")
        return
    }else{
        print("Login Successful")
        return 
   }
})
Sign up to request clarification or add additional context in comments.

3 Comments

Accept and upvote the answer if it solved your issue :) Happy Coding.
That creates more errors :-/ 10 more to be exact. everything else I try seems to break my UIcolor(s) code including this fix :-/
I cannot say anything about other error's but i am definite of this as answer. :) Avoid fanning out question in comments. Post another question or try to debug yourself

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.