title: How to programmatically change UITabBar selected index after Dismiss?
body: <p>I have a modal <code>UIViewController</code> over the <code>UITabBarViewcontroller</code> and i want to dismiss it, then change the selected item of my tab bar.</p>
  
  <p>I'm trying to accomplish it by setting the <code>selectedIndex</code> inside dismiss' completion:</p>
  
  <pre><code>self.dismiss(animated: true, completion: {
      self.tabBarController?.selectedIndex = 2        
  })
  </code></pre>
  
  <p>I apologize if this is a newbie question, i just couldn't find the solution to this anywhere. Thanks in advance for every answer, clue or old similar questions that you send me :)</p>