I'm struggling to dismiss a UIViewController from the NavigationStack after login is completed.
The login screen is a UIViewController is presented with this line of code
let loginController = LoginController()
self.present(loginController, animated: true, completion: nil)
And then I run this code to log the user in via firebase.
Auth.auth().signIn(withEmail: email, password: password) { (user, err) in
if let err = err {
print("Failed to sign in user with email", err )
}
//self.dismiss(animated: true, completion: nil)
let userProfileVC = UserProfileController()
let navController = UINavigationController(rootViewController: userProfileVC)
self.navigationController?.pushViewController(navController, animated: true)
}
As you can see I have tried the pushViewController method, and have also tried the commented self.dismiss method? Nothing I do seems to remove the loginController UIView and take me back to the UINavigationController home screen. Can anyone help me out, thanks a lot.