I'd like to create a "slide-out-menu" for a portrait application on iOS 9 that allows pan gestures to switch between modes.
I would like it to switch between the modes "Hidden - The secondary view controller is displayed onscreen and the primary view controller is off screen" and "Overlay - The secondary view controller is onscreen and the primary view controller is layered on top of it."
According to Apple's documentation, I need to set preferredDisplayMode for the UISplitViewController. Can somebody tell me where to modify this property?
Hope you created a splitViewController and set that as the rootViewController in your
viewDidLoad of the splitViewController do
masterVC = [[MasterViewController alloc] init];
detailVC = [[DetailViewController alloc] init];
NSArray *vcArray = @[masterVC, detailVC];
self.viewControllers = vcArray;
self.preferredDisplayMode = UISplitViewControllerDisplayModeAutomatic;
self.presentsWithGesture = YES;
self.preferredPrimaryColumnWidthFraction = .10;
self.delegate = (id)self;
// Do any additional setup after loading the view.
It will work for sure I have tested it. MasterViewController is the primary viewController and DetailViewController is the secondaryviewController