When I click the cross button in more view controller the action will push to home view controller.
But the tab bar did not automatically highlight the home tab bar. The result I want is like this
The code below is the action push to home view controller
-(void)tapDetected{
HomeMainViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier: @ "homeVC"];
[self.navigationController pushViewController:vc animated: YES];
}
I assume you are using a UITabBarController. If yes, try this :
UITabBarController* vc = (UITabBarController*) self.parentViewController;
if( vc && [vc isKindOfClass:[MainTabViewController class]] )
{
[vc setSelectedIndex:0];
}