title: In swift, how to set initial view for tabBarController
body: <p>I have 5 tabs in tabBarController.<a href="https://i.stack.imgur.com/Ncs14.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ncs14.png" alt="iamge"></a></p>
  
  <p>Every time I run it, it will show the first tab view.</p>
  
  <p>However I would like my middle tab (tab 3) to be the one that is first displayed when the app tun to tabBarController(if log in success).</p>
  
  <p>How to do that?</p>
  
  <hr>
  
  <p>when i add</p>
  
  <pre><code>self.tabBarController.selectedIndex = 2
  </code></pre>
  
  <p>the middle button was been highlighted, but the view hasn`t been displayed.
  how to deal with that? </p>