I've got 3 view controllers. Two I have hooked up to a tab bar controller and one that I'm wanting to access when a user selects a cell on the second view controller in my tabbed views.
I'm wanting when the user hits "back" on the 3rd "detail" page for the user to be taken back to the 2nd view.
When I do this by just adding a button and segueing back to the 2nd VC, the tab bar is gone. I tried in my viewDidAppear to unhide the tab bar, but I guess going off of the tab bar controller messes up the navigation.
I tried creating a variable that was like "didHitBack" and on my "back" button on the 3rd view I'm creating a segue back to the Tab Bar Controller, and if "didHitBack" is true I do
_ self.tabBarController?.selectedIndex = 1
If you want to build a navigation stack, you should embed your view controller in a
So your tab bar would be hooked up to VC1 and NavVC. The root view controller of NavVC would be VC2.
You can then push a new view controller onto the stack using the navigation controller (or pop the view controller to go back) all within the confines of the tabBar.