I have a split view controller with master view and detail view. Master View is fixed in the delegate function:
-(BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:
(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation
{
return enableMaster;
}
When I click the button on detail view it navigates to a new screen. But on the new screen it still displays the master view.
Code for navigation:
NextViewController *viewController = [...]; \\initialised here;
[self.navigationController pushViewController:viewController animated:YES];
My question:
1. When I navigate to new screen from detail view controller, it should display next screen as a full screen. How to do that?
Note: I don't want to use "presentViewController" to display the next screen because of two reasons.
1. I want to come to previous screen using navigation stack
2. All the screens are also based on Tab bar controller, and if I use "presentViewController" then tab bar controller not longer visible for new screen.
After reading this post: How to hide & unhide Master View Controller in SplitView Controller
Solution: finally my problem has solved:
// In split delegate
-(void)hideMaster:(BOOL)hideState
{
_masterIsHidden = hideState;
[self.splitViewController.view setNeedsLayout];
self.splitViewController.delegate = nil;
self.splitViewController.delegate = self;
[self.splitViewController willRotateToInterfaceOrientation:[UIApplication
sharedApplication].statusBarOrientation duration:0];
}
-(BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:
(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation
{
return self.masterIsHidden;
}
//Call On button:
-(void) btn_click
{
[self hideMaster: TRUE];
}