diff --git a/MFSideMenu/MFSideMenuContainerViewController.m b/MFSideMenu/MFSideMenuContainerViewController.m index 70216e0..e14719b 100644 --- a/MFSideMenu/MFSideMenuContainerViewController.m +++ b/MFSideMenu/MFSideMenuContainerViewController.m @@ -388,11 +388,15 @@ - (void)setMenuState:(MFSideMenuState)menuState completion:(void (^)(void))compl // these callbacks are called when the menu will become visible, not neccessarily when they will OPEN - (void)leftMenuWillShow { [self.leftMenuViewController view].hidden = NO; + [self.leftMenuViewController beginAppearanceTransition:YES animated:YES]; + [self.leftMenuViewController endAppearanceTransition]; [self.menuContainerView bringSubviewToFront:[self.leftMenuViewController view]]; } - (void)rightMenuWillShow { [self.rightMenuViewController view].hidden = NO; + [self.rightMenuViewController beginAppearanceTransition:YES animated:YES]; + [self.rightMenuViewController endAppearanceTransition]; [self.menuContainerView bringSubviewToFront:[self.rightMenuViewController view]]; } @@ -716,6 +720,7 @@ - (void)setUserInteractionStateForCenterViewController { NSArray *viewControllers = [self.centerViewController viewControllers]; for(UIViewController* viewController in viewControllers) { viewController.view.userInteractionEnabled = (self.menuState == MFSideMenuStateClosed); + viewController.navigationController.interactivePopGestureRecognizer.enabled = (self.menuState == MFSideMenuStateClosed); } } } @@ -759,6 +764,18 @@ - (void) setCenterViewControllerOffset:(CGFloat)xOffset { frame.origin.x = xOffset; [self.centerViewController view].frame = frame; + if ([self.panGestureDelegate respondsToSelector:@selector(mfSideMenuPanGestureRecognizerDidPanWithOffset:)]) { + [self.panGestureDelegate mfSideMenuPanGestureRecognizerDidPanWithOffset:xOffset]; + } + if (darkenStatusBarWhenMenuOpens) { + CGFloat menuWidth = MAX(_leftMenuWidth, _rightMenuWidth); + CGFloat menuOpenedPerecent = ABS(xOffset) / menuWidth; + CGRect statusBarFrame = self.statusBarBackgoundView.frame; + statusBarFrame.size.width = self.view.bounds.size.width; + self.statusBarBackgoundView.frame = statusBarFrame; + self.statusBarBackgoundView.alpha = menuOpenedPerecent; + } + if(!self.menuSlideAnimationEnabled) return; if(xOffset > 0){ @@ -791,4 +808,4 @@ - (CGFloat)animationDurationFromStartPosition:(CGFloat)startPosition toEndPositi return MIN(duration, self.menuAnimationMaxDuration); } -@end \ No newline at end of file +@end