My root view controller is a UITabBarController. I\'m trying to present a modal view controller over one of the tab bar controller\'s view controllers, but still allow the
I reproduced your problem and found a solution. It does not involve changing the segue method or changing some attributes in the storyboard.
Suggestion:
But before going to the solution I would like to add that the purpose of modally presented viewcontrollers is to distrupt the actual flow of the app and present some extra contextual information or some actionable contents for the presenting vc. Simply put it is very logical and actually recommended to cover the tab bar when presenting a view controller modally. There are lots of good examples of it in the app store.Having said that here is a solution I propose.
Solution:
I believe the problem lies in the way UITabBarController handles its view hierarchy. What I did was explicitly dismiss the modally presented view controller before the tab was changed. This made the presenting view controller persist in the view hierarchy of the UITabBarViewController before the tab bar switches to new tab.In the "viewWillDisappear" method of your modally presented ViewController add this.
- (void)viewWillDisappear:(BOOL)animated {
[self dismissViewControllerAnimated:true completion:^{
[super viewWillDisappear:animated];
}];
}