title: Is there a way to assign the rootViewController of a NavigationController?
body: <p>Is there a way to change root controller when someone is midway into using the app? The way I have it set up right now is that if a new user uses the app they will go into a login page that has the embedded navigation controller. When the user fills out the information they go onto the next page to confirm. The embedded navigation is to go back and change any info. Once they confirm they go to the main page. Now the issue is that the app goes to a different view that already has a Navigation Controller when the user returns and follows some logic. How do I assign the returning user navigation controller when the new user gets into that section? When the user presses back while they are on the blank view they will go back to  the confirmation page.
  <a href="https://i.stack.imgur.com/HWUnG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HWUnG.png" alt="enter image description here"></a></p>
  
  <p>How do I have the confirmation page view get the navigation controller on the top and not the bottom? I'm not sure where to change the Root Navigation Controller but I assume it should be in the <code>prepareForSegue</code> in Confirmation View Controller</p>
  
  <pre><code>if segue.identifier == "showMemoryTable" {
               let memoryListVC = segue.destination as? ReturningUserCityDetailTableViewController
              memoryListVC?.userData = userData
              if userData?.newUser == true {
                  let newRootViewController = ReturningUserCityTableViewController()
                  self.navigationController?.viewControllers.first = newRootViewController
                  let mainStoryBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
                  let viewController: UIViewController = mainStoryBoard.instantiateViewController(withIdentifier: "homeVC") 
                  navigationController?.setViewControllers([viewController], animated: true)
  
              }
  </code></pre>
  
  <p>I am not sure if I should use <code>setViewControllers</code> but I believe so</p>