I have a problem with my app organization. I want an home view with four buttons. Each one pushing the view to a splitView.
So in my home view, I do not want any masterView displayed, ether in portrait or landscape mode. But in my four next views, I want the masterView displayed at any time and I want to be able to have a back button to return to the home view.
My question is how do I achieve such a thing ?
A UISplitViewController has to be the root view controller.
So you would start your app with a homeViewController that contains four buttons, each of which would tell your app delegate to remove the home view controller from root and create a splitViewController and make that the root.
Obviously to go back you would need a button on your splitViewController that would tell the app delegate to remove the splitViewController and replace with the newly loaded homeViewController.
an example of getting a viewController from a storyboard and attaching it to the window
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *homeViewController = [mainStoryboard instantiateViewControllerWithIdentifier:@"HomeViewController"];
[window addSubview:homeViewController.view];
[window makeKeyAndVisible];