Reputation: 4731
Ok so I have a TabBarController that is segued up to four ViewControllers. One of these view controllers is set up so that when you select an item from a TableView It goes to a different ViewController that is not on the TabBarController. My problem arises when I want to go back from the ViewController that is not segued to the TabBarController. If I set up a push segue back to the ViewController, I want to go to, it will transition but the TabBar does not appear. If I set up a segue going back to the TabBarController it shows the TabBar but it goes back to the first tab (which is definitely not what I want). Is there a way to tell it to go to the third tab or a specific ViewController? Or just create a segue directly back to the ViewController I want and have the tab bar appear.
This is what my storyboard looks like for a better reference. The VCs I am talking about are the ones in the middle right hand side.
Upvotes: 1
Views: 1278
Reputation: 3067
In your class for the VC that is not in the TabBar, create an IBAction from the "Back" button and just call dismissViewControllerAnimated(true, completion: nil)
Here is a link to the sample project:
https://drive.google.com/file/d/0B174p0JH6p7uQ1pLQnhuOEV0ejA/edit?usp=sharing
Hope that helps.
Upvotes: 2