BDBSplitViewController
BDBSplitViewController copied to clipboard
UISplitViewController default behaviour
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.
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?