0

I'm struggling in a very strange case: I've created a UISplitViewController

self.splitViewController = [[UISplitViewController alloc] init];
self.splitViewController.presentsWithGesture = YES;

UIViewController * master = [[UIViewController alloc] init];
master.view.backgroundColor = [UIColor yellowColor];
UINavigationController * navMaster = [[UINavigationController alloc] initWithRootViewController:master];

UIViewController * detail = [[UIViewController alloc] init];
detail.view.backgroundColor = [UIColor redColor];
UINavigationController * navDetail = [[UINavigationController alloc] initWithRootViewController:detail];

self.splitViewController.viewControllers = @[navMaster,navDetail];

self.window.rootViewController = self.splitViewController;
[self.window makeKeyAndVisible];

but the swipe gesture (like in Mail app) to open/show master view controller doesn't work in iOS7 but works in iOS8. If I create a new project from Master/Detail template the gesture works. But I need to create UISplitViewController programmatically because I have to add after a login page that is a normal view controller. I don't want use storyboard because in this application will be too large.

1 Answer 1

1

I was experiencing the same problem and found this Awesome Tutorial of how to make it work: New UISPlitViewController and iOS7

With this you can also use Size Classes and use only 1 Storyboard to support iPhone as well and take advantage of iPhone 6+ landscape Split View functionality.

Note: You have to use Storyboards if you want to use Size Classes and still support iOS 7. (There is no backward compatibility if you use them by code)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.