I have a
UISplitViewControllerwhich I have set asrootViewControllerinappDelegate.But before displayingUISplitViewController,there are twoUIViewControllers. When the app starts,there will beUIViewControllerone after another.Then from secondUIViewController,it will navigate toUISplitViewController. Now,it is simple to displayUISplitViewControllerfrom UIViewControllers, but problem arises when i want to displayUIViewControllerfromUISplitViewController. Means,unable to navigate betweenUIViewControllersandUISplitViewController. I have checked every solution.I also tried topresentViewControllerbut it just failed. Please help me. It would be great pleasure to get solution from here.
Asked
Active
Viewed 169 times
0
Sushil Sharma
- 2,321
- 3
- 29
- 49
2 Answers
0
check this link.According to your question i too tried like this before after that i googled and i got this solution.
How to create a segue from UIViewController to a UISplitViewController
Community
- 1
- 1
Ganesh Kumar
- 708
- 6
- 25
-
Thanks for your reply @user3698223. I have tried this code.I am adding `UISplitViewController` same like this.But the problem is that I can't Pop back from `UISplitViewController` to `UIViewController`. As you said ,you were having same problem then how did you pop to `UIViewController` from `UISplitViewController`?. – Sushil Sharma Aug 08 '14 at 11:27
0
I was facing the same issue.I resolved this problem by putting whole project in UISplitViewController and then hiding/Unhiding the masterViewController. Here is the code to hide the MasterViewController. Firstly using UISplitViewController's Delegate method
- (BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation
{
return YES;
}
then declare this BOOL masterIsHidden; under implementation then add the following method
-(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];
}
and call this above method in viewWillAppear like this
[self hideMaster:YES];
Using this method you can hide/Unhide masterViewController anywhere in your project.
Sushil Sharma
- 2,321
- 3
- 29
- 49
Sushil Sharma
- 945
- 1
- 7
- 9