BDBSplitViewController icon indicating copy to clipboard operation
BDBSplitViewController copied to clipboard

UISplitViewController default behaviour

Open bguidolim opened this issue 9 years ago • 1 comments

Is there a way to hide master view when it's in portrait mode, just showing when button item was tapped without changing detail view frame?

Is there a way to show master view when it's in landscape mode without possibilities to hide it?

These two question is about the default behaviour of UISplitViewController.

bguidolim avatar Apr 07 '15 13:04 bguidolim

I've used this:

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
    [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];

    if (UIDeviceOrientationIsPortrait(toInterfaceOrientation)) {
        self.bdb_splitViewController.masterViewDisplayStyle = BDBSplitViewControllerMasterDisplayStyleDrawer;
        self.navigationItem.leftBarButtonItem = self.bdb_splitViewController.showHideMasterViewButtonItem;
    } else {
        self.bdb_splitViewController.masterViewDisplayStyle = BDBSplitViewControllerMasterDisplayStyleNormal;
        self.navigationItem.leftBarButtonItem = nil;
    }
}

Is this a best practice?

bguidolim avatar Apr 07 '15 14:04 bguidolim