Reputation: 2212
So is it possible to push UIViewController from UISplitViewController?
Upvotes: 1
Views: 67
Reputation: 4436
If you're trying to get a single view to display in a UISplitViewController, you will need to hide the master. You can do this by modifying the UISplitViewDelegate This is what I use:
BOOL hideMaster = NO;
- (void)hideMaster
{
hideMaster = YES;
UISplitViewController *sv = (UISplitViewController *)[UIApplication sharedApplication].keyWindow.rootViewController;
[sv.view setNeedsLayout];
[sv willRotateToInterfaceOrientation:[[UIApplication sharedApplication] statusBarOrientation] duration:0];
}
- (BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation
{
return hideMaster;
}
So, if you've got a UINavigationController in the detail screen, it's just a matter of hiding the master and pushing your other view into the detail panel.
Upvotes: 2