title: Basic: Connecting multiple (View-)Controllers the right way
body: <p>I'm trying to set up a login screen (<code>ViewController</code>) that leads - after a successful login - to a user list (<code>UserTableViewController</code>) that is itself part of a navigation controller. On the subsequent screens like the <code>UserTableViewController</code> it should be possible to logout. This would bring the user back to the initial login screen <code>ViewController</code>. I'm really struggling connecting those screens the right way. It must be said that I don't have a lot of experience with the different kinds of segues and/or delegates so, with some research done, I went for some trials:</p>
  
  <ol>
  <li>A successful login on <code>ViewController</code> triggers a modal-segue to the navigation controller (that itself leads to the <code>UserTableViewController</code>)</li>
  <li>The <code>UserTableViewController</code> has a logout button that triggers another modal-segue back to the <code>ViewController</code>. I took these modal segues because first, I didn't want to have a hierarchy that leads to an automatically created back-button or similar and second, I didn't want to have any "troubles" between these two screens, one having a navigation controller while the other one doesn't. </li>
  </ol>
  
  <p>...it looks like that's not a way to go. Some things get mixed up after one loop and screens are changing the wrong way. I guess a modal-segue-circle is not possible as there has to be parent and a child at least. Next trial:</p>
  
  <ol>
  <li>A successful login on <code>ViewController</code> triggers a modal-segue / push-segue to the navigation controller (that itself leads to the <code>UserTableViewController</code>)</li>
  <li>To return to the login screen I implemented a delegate instead of another segue, triggered when tapping "logout" - here I'm facing the problem that I can't set up the <code>UserTableViewController</code>'s delegate in <code>preparingForSegue</code> on <code>ViewController</code> properly. At this point <code>segue.destinationViewController</code> cannot be downcasted to <code>UserTableViewController</code> but only to <code>NavigationController</code> what doesn't allow me to set up the delegate at the destination (<code>UserTableViewController</code>).</li>
  </ol>
  
  <p>The third trial was to do the same like in the second approach but implementing a segue from <code>ViewController</code> 
  to <code>UserTableViewController</code> directly. That may work but now I don't have any navigation bar anymore at my <code>UserTableViewController</code>...!</p>
  
  <p>Of course I could go for a manual fix in the third solution like inserting a stand-alone navigation bar but neither way seems to be efficient. Therefore I'd very very thankful for some hints, highlighting what I misunderstood (completely) on one side and showing a good way of doing it on the other side. Thanks a lot for any help!</p>
  
  <p>EDIT:
  I could try to set the navigation controller as initial view controller and then just let the login screen <code>ViewController</code> being presented/dismissed by the <code>UserTableViewController</code> - is that a practical way or are there widely known best practices for those login view scenario?</p>
  
  <p>Just a visual help:
  <img src="https://i.stack.imgur.com/0gsFJ.png" alt="enter image description here"></p>