title: TabBarController doesn't change selected index
body: <p>I'm trying to change selected tabBarItem ( and Controller ) from index 1 to index 0.</p>
  
  <p>This is my code:</p>
  
  <pre><code>  override func viewDidLoad() {
  
      super.viewDidLoad()
      self.tabBarController?.delegate = self
  
  
      if UserDefaults.standard.double(forKey: "is_logged") !=  1 {
          // print always selectedIndex= Optional(0)
          print("selectedIndex= \(self.tabBarController?.selectedIndex)")
          self.tabBarController?.selectedIndex = 0            
       }    
  
      } 
  </code></pre>