Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions LMSideBarController/LMSideBarController.m
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,24 @@ - (void)setMenuViewController:(UIViewController *)menuViewController forDirectio

// Add the new one
[self.menuViewControllers setObject:menuViewController forKey:@(direction)];

// Get style for direction, use menuWidth as SideBar width
// Default to 75% view width
LMSideBarStyle *style = [self styleForDirection:direction];
CGFloat width = style.menuWidth;
if(width == 0){
width = self.view.bounds.size.width * 3.0/4.0;
}
if (direction == LMSideBarControllerDirectionLeft) {
[self setupViewController:menuViewController frame:CGRectMake(-self.view.bounds.size.width,
[self setupViewController:menuViewController frame:CGRectMake(-width,
0,
self.view.bounds.size.width,
width,
self.view.bounds.size.height)];
}
else {
[self setupViewController:menuViewController frame:CGRectMake(self.view.bounds.size.width,
0,
self.view.bounds.size.width,
width,
self.view.bounds.size.height)];
}
menuViewController.view.hidden = YES;
Expand Down