0
votes

In my application, I have a default tab selected for my Tab Bar Controller. On the viewDidLoad() of the default tab, I have this:

if (NSUserDefaults.standardUserDefaults().stringForKey("defaultCode") == nil) {
    //let navController:UINavigationController = UINavigationController()
    //self.presentViewController(navController, animated: true, completion: nil)
    self.tabBarController!.selectedIndex = 1

I thought calling selectedIndex would do what I was looking forever; however, it only changes the selected tab in the TabBar, but my view does not change. The area I commented out quickly shows the proper view, then goes to a black screen. The view I am trying to switch to is a Navigation Controller

1

1 Answers

0
votes

selectedIndex always be the first and pop/push after selected