Changing MasterViewController width in UISplitViewController iOS 8 iPhone not working

318 Views Asked by At

So I am trying to build an iPhone app that uses a SplitView for the main screen Similar to the app Lyft or like basically this controller https://github.com/mutualmobile/MMDrawerController.

I have set up the following storyboard (I am not using SizeClasses) :

enter image description here

I have subclassed the SplitViewController to try to set a max width for my MasterViewController:

// File .h

#import <UIKit/UIKit.h>

@interface LLSplitViewController : UISplitViewController <UISplitViewControllerDelegate>

@property(nonatomic, assign) CGFloat maximumPrimaryColumnWidth NS_AVAILABLE_IOS(8_0);

@end

// File .m

@implementation LLSplitViewController

-(void)viewDidLoad{

    self.delegate = self;
    self.preferredPrimaryColumnWidthFraction = .1;
    CGRect mainScreen = [[UIScreen mainScreen] bounds];
    self.maximumPrimaryColumnWidth = mainScreen.size.width - 100;
}

@end

What am I missing here?

1

There are 1 best solutions below

0
On

I ended up using this framework to achieve my goal.

It is not a splitcontroller but it works similar to it and it seems to be very well maintained.