title: Switch tab bar programmatically in Swift
body: <p>I have a tab bar application and i have a button on my first view which i want to when pressed switch to my second tab programmatically in the tab bar.</p>
  
  <p>I can't quite seem to figure it out how to get the index etc to switch to it i've tried stuff like this.</p>
  
  <pre><code>tababarController.selectedIndex = 1
  </code></pre>
  
  <p>With no success.</p>