I have the following setup:
This is a simple graphical representation:
My problem is the following: Given that there are two paths to the shopping cart, it's possible to have two instances of it and that's very confusing to the user. How do I make sure the cart always loads in tab 1?
Create yours custom segue: subclass UIStoryboardSegue
and in -perofrm
implement opening first tab and pushing SecondViewController.
- (void) perform
{
SecondTabViewController* stvc = self.sourceViewController;
UITabBarController* tbc = stvc.navigationController.tabBarController;
UINavigationViewController* nvc = tbc.viewControllers.firstObject;
tbc.selectedViewController = nvc;
[nvc pushViewController:self.destinationViewController animated:YES];
}