I have a login scene that segues to another scene when the user clicks the login in button, but, I'm trying to stop it from happening when the user email and password is incorrect. I'm using Firebase and this function below checks to see whether the username and password are correct, but I want to stop the segue from happening when it's not correct.
func userLogin (user: String!, pass: String!){
ref.authUser(user, password: pass,
withCompletionBlock: { error, authData in
if error != nil {
print("user account doesnt exist")
} else {
print("You're logged in Fam")
}
})
}