Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

UISplitViewController default behaviour #15

Open
bguidolim opened this issue Apr 7, 2015 · 1 comment
Open

UISplitViewController default behaviour #15

bguidolim opened this issue Apr 7, 2015 · 1 comment

Comments

@bguidolim
Copy link

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
Copy link
Author

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant