title: How to dismiss controller and then switch tabs
body: <p>I have two main VC that are in a tab bar controller. On the first VC when you tap a button you are taken to another VC (not the 2nd tab bar VC) and when you tap the finish button I want to go to the 2nd tab bar vc.</p>
  
  <p>Normally I would just perform segue ... but when I do that it removes the tab bar at the bottom. So, I am now just dismissing and going back to the original VC, but I would really like to go to the 2nd tab bar vc so I tried this </p>
  
  <pre><code>dismiss(animated: true) { 
    self.tabBarController?.selectedIndex = 2
  }
  </code></pre>
  
  <p>I saw the self.tabBar... on another SO post, but I can't seem to find where I set the Index...ive tried 1 in case it just automatically starts from 0, and Ive tried 2 in case it starts from 1</p>
  
  <p>Am I close or is there a better way of achieving what I want?</p>
  
  <p><strong>Summary</strong></p>
  
  <p>To summarize clearly. I have 3 View Controllers. 1 and 3 are in a Tab Bar Controller. VC 2 is NOT in the TBC. To get to VC 2 there is a button on VC 1. When the user is finished on VC 2 he/she taps a button. Instead of just dismissing back to VC 1 I want to go to VC 3, but when I perform segue it goes to VC 3 but removes the Tab Bar</p>