2

I'm having a problem where every time I enter the right credentials, it brings me to one view controller then opens up the same view controller again even though I only have the login viewer controller linked to one view controller. If I don't enter the right credentials it still brings me into the linked view controller. Here is the code.

EDIT: Using a push segue(show)

 @IBAction func loginTapped(_ sender: Any) { if let Email = userEmail.text, let Pass = userPassword.text{ Auth.auth().signIn(withEmail: Email, password: Pass, completion: { (user, error) in if error != nil{ print("incorrect") } else{ if error == nil{ self.performSegue(withIdentifier: "loginPage", sender: self) print("correct") } } }) } } 

1 Answer 1

1

I don't know if you've fixed your problem, but check your storyboard. Sounds like you have a segue connected from the button to the next ViewController which would result in pressing the button and it'll always push that ViewController.

To do this easily just see if you have a segue connected from the button to your destination ViewController in your MainStoryboard.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.