title: Branching off from a tab bar controller?
body: <p>I've got 3 view controllers. Two I have hooked up to a tab bar controller and one that I'm wanting to access when a user selects a cell on the second view controller in my tabbed views.</p>
  
  <p>I'm wanting when the user hits "back" on the 3rd "detail" page for the user to be taken back to the 2nd view. </p>
  
  <p>When I do this by just adding a button and segueing back to the 2nd VC, the tab bar is gone. I tried in my viewDidAppear to unhide the tab bar, but I guess going off of the tab bar controller messes up the navigation.</p>
  
  <p>I tried creating a variable that was like "didHitBack" and on my "back" button on the 3rd view I'm creating a segue back to the Tab Bar Controller, and if "didHitBack" is true I do </p>
  
  <pre><code>_ self.tabBarController?.selectedIndex = 1
  </code></pre>
  
  <p>which takes me to the second page, but it's loading the first view in then going to the second page which looks bad.</p>
  
  <p>I was thinking maybe there was a way to do "didHitBack" and setting the tab bar's initial view controller to the second one or something, but that all just seems very wrong.</p>
  
  <p>Is there a "proper" way to do this?</p>
  
  <p>To recap I have VC1 and VC2 that are hooked up to a Tab Bar Controller, I have a tableview on VC2 that on didSelectRow I'm going to VC3 which I do not want to be a part of the tabbed view controller, and when I hit back on VC3 I want to go back to VC2. </p>