The user logs in and lands on viewNumOne, they fill out their name and address and get to see viewNumTwo and viewNumThree. They now logout. When they log back in I want them to go straight to viewColorBlue (this is where I am having the problem).
(Login Screen) View Controller with login fields. Once logged in they go to the rootVC which is a TabBar and they land on the first tab which is viewNumOne (this works fine)
(Root) TabBar:
(First Tab - tabBar[0]) viewNumNavController > viewNumOne (name/address info fields are here) > viewNumTwo > viewNumThree
(Second Tab - tabBar[1]) viewColorNavController > viewColorRed > viewColorBlue > viewColorWhite (logout button is here)
Here is the code I tried but it crashes:
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let tabBarController = mainStoryboard.instantiateInitialViewController() as! UITabBarController
tabBarController.selectedIndex = 1
let viewColorNaviCon = tabBarController.viewControllers![1] as! UINavigtionController
let viewColorBlueVC = viewColorNaviCon.topViewController as! ViewColorBlueController
self.presentViewController(viewColorBlueVC, animated: true, completion: nil)