title: Can't dismiss UIViewController after Successful Login
body: <p>I'm struggling to dismiss a UIViewController from the NavigationStack after login is completed.</p>
  
  <p>The login screen is a UIViewController is presented with this line of code</p>
  
  <pre><code>        let loginController = LoginController()
          self.present(loginController, animated: true, completion: nil)
  </code></pre>
  
  <p>And then I run this code to log the user in via firebase.</p>
  
  <pre><code>        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)
  
      }
  </code></pre>
  
  <p>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.</p>