diff --git a/SlideMenu/Helper Classes/HomeViewController.m b/SlideMenu/Helper Classes/HomeViewController.m index f0d54fe..adab9dc 100755 --- a/SlideMenu/Helper Classes/HomeViewController.m +++ b/SlideMenu/Helper Classes/HomeViewController.m @@ -40,11 +40,11 @@ - (BOOL)slideNavigationControllerShouldDisplayRightMenu - (IBAction)bounceMenu:(id)sender { - static Menu menu = MenuLeft; + static MenuSide menu = MenuSideLeft; [[SlideNavigationController sharedInstance] bounceMenu:menu withCompletion:nil]; - menu = (menu == MenuLeft) ? MenuRight : MenuLeft; + menu = (menu == MenuSideLeft) ? MenuSideRight : MenuSideLeft; } - (IBAction)slideOutAnimationSwitchChanged:(UISwitch *)sender @@ -59,7 +59,7 @@ - (IBAction)limitPanGestureSwitchChanged:(UISwitch *)sender - (IBAction)changeAnimationSelected:(id)sender { - [[SlideNavigationController sharedInstance] openMenu:MenuRight withCompletion:nil]; + [[SlideNavigationController sharedInstance] openMenu:MenuSideRight withCompletion:nil]; } - (IBAction)shadowSwitchSelected:(UISwitch *)sender diff --git a/SlideMenu/Source/Animations/SlideNavigationContorllerAnimator.h b/SlideMenu/Source/Animations/SlideNavigationContorllerAnimator.h index acea162..4373cc0 100644 --- a/SlideMenu/Source/Animations/SlideNavigationContorllerAnimator.h +++ b/SlideMenu/Source/Animations/SlideNavigationContorllerAnimator.h @@ -32,10 +32,10 @@ // Initial state of the view before animation starts // This gets called right before the menu is about to reveal -- (void)prepareMenuForAnimation:(Menu)menu; +- (void)prepareMenuForAnimation:(MenuSide)menu; // Animate the view based on the progress (progress is between 0 and 1) -- (void)animateMenu:(Menu)menu withProgress:(CGFloat)progress; +- (void)animateMenu:(MenuSide)menu withProgress:(CGFloat)progress; // Gets called ff for any the instance of animator is being change // You should make any cleanup that is needed diff --git a/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorFade.m b/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorFade.m index 09c3e60..fe85bf6 100644 --- a/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorFade.m +++ b/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorFade.m @@ -60,9 +60,9 @@ - (id)initWithMaximumFadeAlpha:(CGFloat)maximumFadeAlpha andFadeColor:(UIColor * #pragma mark - SlideNavigationContorllerAnimation Methods - -- (void)prepareMenuForAnimation:(Menu)menu +- (void)prepareMenuForAnimation:(MenuSide)menu { - UIViewController *menuViewController = (menu == MenuLeft) + UIViewController *menuViewController = (menu == MenuSideLeft) ? [SlideNavigationController sharedInstance].leftMenu : [SlideNavigationController sharedInstance].rightMenu; @@ -70,9 +70,9 @@ - (void)prepareMenuForAnimation:(Menu)menu self.fadeAnimationView.frame = menuViewController.view.bounds; } -- (void)animateMenu:(Menu)menu withProgress:(CGFloat)progress +- (void)animateMenu:(MenuSide)menu withProgress:(CGFloat)progress { - UIViewController *menuViewController = (menu == MenuLeft) + UIViewController *menuViewController = (menu == MenuSideLeft) ? [SlideNavigationController sharedInstance].leftMenu : [SlideNavigationController sharedInstance].rightMenu; diff --git a/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorScale.m b/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorScale.m index 93fb90b..fc969fd 100644 --- a/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorScale.m +++ b/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorScale.m @@ -52,18 +52,18 @@ - (id)initWithMinimumScale:(CGFloat)minimumScale #pragma mark - SlideNavigationContorllerAnimation Methods - -- (void)prepareMenuForAnimation:(Menu)menu +- (void)prepareMenuForAnimation:(MenuSide)menu { - UIViewController *menuViewController = (menu == MenuLeft) + UIViewController *menuViewController = (menu == MenuSideLeft) ? [SlideNavigationController sharedInstance].leftMenu : [SlideNavigationController sharedInstance].rightMenu; menuViewController.view.transform = CGAffineTransformScale(menuViewController.view.transform, self.minimumScale, self.minimumScale); } -- (void)animateMenu:(Menu)menu withProgress:(CGFloat)progress +- (void)animateMenu:(MenuSide)menu withProgress:(CGFloat)progress { - UIViewController *menuViewController = (menu == MenuLeft) + UIViewController *menuViewController = (menu == MenuSideLeft) ? [SlideNavigationController sharedInstance].leftMenu : [SlideNavigationController sharedInstance].rightMenu; diff --git a/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorScaleAndFade.m b/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorScaleAndFade.m index 84f7929..60b6571 100644 --- a/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorScaleAndFade.m +++ b/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorScaleAndFade.m @@ -60,13 +60,13 @@ - (id)initWithMaximumFadeAlpha:(CGFloat)maximumFadeAlpha fadeColor:(UIColor *)fa #pragma mark - SlideNavigationContorllerAnimation Methods - -- (void)prepareMenuForAnimation:(Menu)menu +- (void)prepareMenuForAnimation:(MenuSide)menu { [self.fadeAnimation prepareMenuForAnimation:menu]; [self.scaleAnimation prepareMenuForAnimation:menu]; } -- (void)animateMenu:(Menu)menu withProgress:(CGFloat)progress +- (void)animateMenu:(MenuSide)menu withProgress:(CGFloat)progress { [self.fadeAnimation animateMenu:menu withProgress:progress]; [self.scaleAnimation animateMenu:menu withProgress:progress]; diff --git a/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorSlide.m b/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorSlide.m index c694520..31b4838 100644 --- a/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorSlide.m +++ b/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorSlide.m @@ -52,9 +52,9 @@ - (id)initWithSlideMovement:(CGFloat)slideMovement #pragma mark - SlideNavigationContorllerAnimation Methods - -- (void)prepareMenuForAnimation:(Menu)menu +- (void)prepareMenuForAnimation:(MenuSide)menu { - UIViewController *menuViewController = (menu == MenuLeft) + UIViewController *menuViewController = (menu == MenuSideLeft) ? [SlideNavigationController sharedInstance].leftMenu : [SlideNavigationController sharedInstance].rightMenu; @@ -63,7 +63,7 @@ - (void)prepareMenuForAnimation:(Menu)menu if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) { - rect.origin.x = (menu == MenuLeft) ? self.slideMovement*-1 : self.slideMovement; + rect.origin.x = (menu == MenuSideLeft) ? self.slideMovement*-1 : self.slideMovement; } else { @@ -71,22 +71,22 @@ - (void)prepareMenuForAnimation:(Menu)menu { if (orientation == UIDeviceOrientationLandscapeRight) { - rect.origin.y = (menu == MenuLeft) ? self.slideMovement*-1 : self.slideMovement; + rect.origin.y = (menu == MenuSideLeft) ? self.slideMovement*-1 : self.slideMovement; } else { - rect.origin.y = (menu == MenuRight) ? self.slideMovement*-1 : self.slideMovement; + rect.origin.y = (menu == MenuSideRight) ? self.slideMovement*-1 : self.slideMovement; } } else { if (orientation == UIDeviceOrientationPortrait) { - rect.origin.x = (menu == MenuLeft) ? self.slideMovement*-1 : self.slideMovement; + rect.origin.x = (menu == MenuSideLeft) ? self.slideMovement*-1 : self.slideMovement; } else { - rect.origin.x = (menu == MenuRight) ? self.slideMovement*-1 : self.slideMovement; + rect.origin.x = (menu == MenuSideRight) ? self.slideMovement*-1 : self.slideMovement; } } } @@ -94,22 +94,22 @@ - (void)prepareMenuForAnimation:(Menu)menu menuViewController.view.frame = rect; } -- (void)animateMenu:(Menu)menu withProgress:(CGFloat)progress +- (void)animateMenu:(MenuSide)menu withProgress:(CGFloat)progress { - UIViewController *menuViewController = (menu == MenuLeft) + UIViewController *menuViewController = (menu == MenuSideLeft) ? [SlideNavigationController sharedInstance].leftMenu : [SlideNavigationController sharedInstance].rightMenu; UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; - NSInteger location = (menu == MenuLeft) + NSInteger location = (menu == MenuSideLeft) ? (self.slideMovement * -1) + (self.slideMovement * progress) : (self.slideMovement * (1-progress)); - if (menu == MenuLeft) + if (menu == MenuSideLeft) location = (location > 0) ? 0 : location; - if (menu == MenuRight) + if (menu == MenuSideRight) location = (location < 0) ? 0 : location; CGRect rect = menuViewController.view.frame; @@ -135,15 +135,15 @@ - (void)animateMenu:(Menu)menu withProgress:(CGFloat)progress - (void)clear { - [self clearMenu:MenuLeft]; - [self clearMenu:MenuRight]; + [self clearMenu:MenuSideLeft]; + [self clearMenu:MenuSideRight]; } #pragma mark - Private Method - -- (void)clearMenu:(Menu)menu +- (void)clearMenu:(MenuSide)menu { - UIViewController *menuViewController = (menu == MenuLeft) + UIViewController *menuViewController = (menu == MenuSideLeft) ? [SlideNavigationController sharedInstance].leftMenu : [SlideNavigationController sharedInstance].rightMenu; diff --git a/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorSlideAndFade.m b/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorSlideAndFade.m index c0119b7..fdec0a6 100644 --- a/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorSlideAndFade.m +++ b/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorSlideAndFade.m @@ -60,13 +60,13 @@ - (id)initWithMaximumFadeAlpha:(CGFloat)maximumFadeAlpha fadeColor:(UIColor *)fa #pragma mark - SlideNavigationContorllerAnimation Methods - -- (void)prepareMenuForAnimation:(Menu)menu +- (void)prepareMenuForAnimation:(MenuSide)menu { [self.fadeAnimation prepareMenuForAnimation:menu]; [self.slideAnimation prepareMenuForAnimation:menu]; } -- (void)animateMenu:(Menu)menu withProgress:(CGFloat)progress +- (void)animateMenu:(MenuSide)menu withProgress:(CGFloat)progress { [self.fadeAnimation animateMenu:menu withProgress:progress]; [self.slideAnimation animateMenu:menu withProgress:progress]; diff --git a/SlideMenu/Source/SlideNavigationController.h b/SlideMenu/Source/SlideNavigationController.h index b64701b..e6607c6 100644 --- a/SlideMenu/Source/SlideNavigationController.h +++ b/SlideMenu/Source/SlideNavigationController.h @@ -36,10 +36,10 @@ - (BOOL)slideNavigationControllerShouldDisplayLeftMenu; @end -typedef enum{ - MenuLeft = 1, - MenuRight = 2 -}Menu; +typedef enum { + MenuSideLeft = 1, + MenuSideRight = 2 +} MenuSide; @protocol SlideNavigationContorllerAnimator; @interface SlideNavigationController : UINavigationController @@ -68,8 +68,8 @@ extern NSString *const SlideNavigationControllerDidReveal; - (void)popToRootAndSwitchToViewController:(UIViewController *)viewController withCompletion:(void (^)())completion; - (void)popAllAndSwitchToViewController:(UIViewController *)viewController withSlideOutAnimation:(BOOL)slideOutAnimation andCompletion:(void (^)())completion; - (void)popAllAndSwitchToViewController:(UIViewController *)viewController withCompletion:(void (^)())completion; -- (void)bounceMenu:(Menu)menu withCompletion:(void (^)())completion; -- (void)openMenu:(Menu)menu withCompletion:(void (^)())completion; +- (void)bounceMenu:(MenuSide)menu withCompletion:(void (^)())completion; +- (void)openMenu:(MenuSide)menu withCompletion:(void (^)())completion; - (void)closeMenuWithCompletion:(void (^)())completion; - (void)toggleLeftMenu; - (void)toggleRightMenu; diff --git a/SlideMenu/Source/SlideNavigationController.m b/SlideMenu/Source/SlideNavigationController.m index 2efcdba..015fb70 100644 --- a/SlideMenu/Source/SlideNavigationController.m +++ b/SlideMenu/Source/SlideNavigationController.m @@ -37,7 +37,7 @@ @interface SlideNavigationController() @property (nonatomic, strong) UITapGestureRecognizer *tapRecognizer; @property (nonatomic, strong) UIPanGestureRecognizer *panRecognizer; @property (nonatomic, assign) CGPoint draggingPoint; -@property (nonatomic, assign) Menu lastRevealedMenu; +@property (nonatomic, assign) MenuSide lastRevealedMenu; @property (nonatomic, assign) BOOL menuNeedsLayout; @end @@ -150,7 +150,7 @@ - (void)viewWillLayoutSubviews // On iOS below 8 we just close the menu, iOS8 handles rotation better so we support keepiong the menu open if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0") && [self isMenuOpen]) { - Menu menu = (self.horizontalLocation > 0) ? MenuLeft : MenuRight; + MenuSide menu = (self.horizontalLocation > 0) ? MenuSideLeft : MenuSideRight; [self openMenu:menu withDuration:0 andCompletion:nil]; } @@ -174,10 +174,10 @@ - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrie #pragma mark - Public Methods - -- (void)bounceMenu:(Menu)menu withCompletion:(void (^)())completion +- (void)bounceMenu:(MenuSide)menu withCompletion:(void (^)())completion { [self prepareMenuForReveal:menu]; - NSInteger movementDirection = (menu == MenuLeft) ? 1 : -1; + NSInteger movementDirection = (menu == MenuSideLeft) ? 1 : -1; [UIView animateWithDuration:.16 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ [self moveHorizontallyToLocation:30*movementDirection]; @@ -303,19 +303,19 @@ - (void)closeMenuWithCompletion:(void (^)())completion [self closeMenuWithDuration:self.menuRevealAnimationDuration andCompletion:completion]; } -- (void)openMenu:(Menu)menu withCompletion:(void (^)())completion +- (void)openMenu:(MenuSide)menu withCompletion:(void (^)())completion { [self openMenu:menu withDuration:self.menuRevealAnimationDuration andCompletion:completion]; } - (void)toggleLeftMenu { - [self toggleMenu:MenuLeft withCompletion:nil]; + [self toggleMenu:MenuSideLeft withCompletion:nil]; } - (void)toggleRightMenu { - [self toggleMenu:MenuRight withCompletion:nil]; + [self toggleMenu:MenuSideRight withCompletion:nil]; } - (BOOL)isMenuOpen @@ -424,7 +424,7 @@ - (void)enableTapGestureToCloseMenu:(BOOL)enable } } -- (void)toggleMenu:(Menu)menu withCompletion:(void (^)())completion +- (void)toggleMenu:(MenuSide)menu withCompletion:(void (^)())completion { if ([self isMenuOpen]) [self closeMenuWithCompletion:completion]; @@ -432,10 +432,10 @@ - (void)toggleMenu:(Menu)menu withCompletion:(void (^)())completion [self openMenu:menu withCompletion:completion]; } -- (UIBarButtonItem *)barButtonItemForMenu:(Menu)menu +- (UIBarButtonItem *)barButtonItemForMenu:(MenuSide)menu { - SEL selector = (menu == MenuLeft) ? @selector(leftMenuSelected:) : @selector(righttMenuSelected:); - UIBarButtonItem *customButton = (menu == MenuLeft) ? self.leftBarButtonItem : self.rightBarButtonItem; + SEL selector = (menu == MenuSideLeft) ? @selector(leftMenuSelected:) : @selector(righttMenuSelected:); + UIBarButtonItem *customButton = (menu == MenuSideLeft) ? self.leftBarButtonItem : self.rightBarButtonItem; if (customButton) { @@ -450,9 +450,9 @@ - (UIBarButtonItem *)barButtonItemForMenu:(Menu)menu } } -- (BOOL)shouldDisplayMenu:(Menu)menu forViewController:(UIViewController *)vc +- (BOOL)shouldDisplayMenu:(MenuSide)menu forViewController:(UIViewController *)vc { - if (menu == MenuRight) + if (menu == MenuSideRight) { if ([vc respondsToSelector:@selector(slideNavigationControllerShouldDisplayRightMenu)] && [(UIViewController *)vc slideNavigationControllerShouldDisplayRightMenu]) @@ -460,7 +460,7 @@ - (BOOL)shouldDisplayMenu:(Menu)menu forViewController:(UIViewController *)vc return YES; } } - if (menu == MenuLeft) + if (menu == MenuSideLeft) { if ([vc respondsToSelector:@selector(slideNavigationControllerShouldDisplayLeftMenu)] && [(UIViewController *)vc slideNavigationControllerShouldDisplayLeftMenu]) @@ -472,7 +472,7 @@ - (BOOL)shouldDisplayMenu:(Menu)menu forViewController:(UIViewController *)vc return NO; } -- (void)openMenu:(Menu)menu withDuration:(float)duration andCompletion:(void (^)())completion +- (void)openMenu:(MenuSide)menu withDuration:(float)duration andCompletion:(void (^)())completion { [self enableTapGestureToCloseMenu:YES]; @@ -484,7 +484,7 @@ - (void)openMenu:(Menu)menu withDuration:(float)duration andCompletion:(void (^) animations:^{ CGRect rect = self.view.frame; CGFloat width = self.horizontalSize; - rect.origin.x = (menu == MenuLeft) ? (width - self.slideOffset) : ((width - self.slideOffset )* -1); + rect.origin.x = (menu == MenuSideLeft) ? (width - self.slideOffset) : ((width - self.slideOffset )* -1); [self moveHorizontallyToLocation:rect.origin.x]; } completion:^(BOOL finished) { @@ -499,7 +499,7 @@ - (void)closeMenuWithDuration:(float)duration andCompletion:(void (^)())completi { [self enableTapGestureToCloseMenu:NO]; - Menu menu = (self.horizontalLocation > 0) ? MenuLeft : MenuRight; + MenuSide menu = (self.horizontalLocation > 0) ? MenuSideLeft : MenuSideRight; [UIView animateWithDuration:duration delay:0 @@ -521,10 +521,10 @@ - (void)moveHorizontallyToLocation:(CGFloat)location { CGRect rect = self.view.frame; UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; - Menu menu = (self.horizontalLocation >= 0 && location >= 0) ? MenuLeft : MenuRight; + MenuSide menu = (self.horizontalLocation >= 0 && location >= 0) ? MenuSideLeft : MenuSideRight; if ((location > 0 && self.horizontalLocation <= 0) || (location < 0 && self.horizontalLocation >= 0)) { - [self postNotificationWithName:SlideNavigationControllerDidReveal forMenu:(location > 0) ? MenuLeft : MenuRight]; + [self postNotificationWithName:SlideNavigationControllerDidReveal forMenu:(location > 0) ? MenuSideLeft : MenuSideRight]; } if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) @@ -550,9 +550,9 @@ - (void)moveHorizontallyToLocation:(CGFloat)location [self updateMenuAnimation:menu]; } -- (void)updateMenuAnimation:(Menu)menu +- (void)updateMenuAnimation:(MenuSide)menu { - CGFloat progress = (menu == MenuLeft) + CGFloat progress = (menu == MenuSideLeft) ? (self.horizontalLocation / (self.horizontalSize - self.slideOffset)) : (self.horizontalLocation / ((self.horizontalSize - self.slideOffset) * -1)); @@ -588,14 +588,14 @@ - (CGRect)initialRectForMenu return rect; } -- (void)prepareMenuForReveal:(Menu)menu +- (void)prepareMenuForReveal:(MenuSide)menu { // Only prepare menu if it has changed (ex: from MenuLeft to MenuRight or vice versa) if (self.lastRevealedMenu && menu == self.lastRevealedMenu) return; - UIViewController *menuViewController = (menu == MenuLeft) ? self.leftMenu : self.rightMenu; - UIViewController *removingMenuViewController = (menu == MenuLeft) ? self.rightMenu : self.leftMenu; + UIViewController *menuViewController = (menu == MenuSideLeft) ? self.leftMenu : self.rightMenu; + UIViewController *removingMenuViewController = (menu == MenuSideLeft) ? self.rightMenu : self.leftMenu; self.lastRevealedMenu = menu; @@ -655,9 +655,9 @@ - (CGFloat)horizontalSize } } -- (void)postNotificationWithName:(NSString *)name forMenu:(Menu)menu +- (void)postNotificationWithName:(NSString *)name forMenu:(MenuSide)menu { - NSString *menuString = (menu == MenuLeft) ? NOTIFICATION_USER_INFO_MENU_LEFT : NOTIFICATION_USER_INFO_MENU_RIGHT; + NSString *menuString = (menu == MenuSideLeft) ? NOTIFICATION_USER_INFO_MENU_LEFT : NOTIFICATION_USER_INFO_MENU_RIGHT; NSDictionary *userInfo = @{ NOTIFICATION_USER_INFO_MENU : menuString }; [[NSNotificationCenter defaultCenter] postNotificationName:name object:nil userInfo:userInfo]; } @@ -668,11 +668,11 @@ - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { - if ([self shouldDisplayMenu:MenuLeft forViewController:viewController]) - viewController.navigationItem.leftBarButtonItem = [self barButtonItemForMenu:MenuLeft]; + if ([self shouldDisplayMenu:MenuSideLeft forViewController:viewController]) + viewController.navigationItem.leftBarButtonItem = [self barButtonItemForMenu:MenuSideLeft]; - if ([self shouldDisplayMenu:MenuRight forViewController:viewController]) - viewController.navigationItem.rightBarButtonItem = [self barButtonItemForMenu:MenuRight]; + if ([self shouldDisplayMenu:MenuSideRight forViewController:viewController]) + viewController.navigationItem.rightBarButtonItem = [self barButtonItemForMenu:MenuSideRight]; } - (CGFloat)slideOffset @@ -689,7 +689,7 @@ - (void)leftMenuSelected:(id)sender if ([self isMenuOpen]) [self closeMenuWithCompletion:nil]; else - [self openMenu:MenuLeft withCompletion:nil]; + [self openMenu:MenuSideLeft withCompletion:nil]; } - (void)righttMenuSelected:(id)sender @@ -697,7 +697,7 @@ - (void)righttMenuSelected:(id)sender if ([self isMenuOpen]) [self closeMenuWithCompletion:nil]; else - [self openMenu:MenuRight withCompletion:nil]; + [self openMenu:MenuSideRight withCompletion:nil]; } #pragma mark - Gesture Recognizing - @@ -726,14 +726,14 @@ - (void)panDetected:(UIPanGestureRecognizer *)aPanRecognizer CGPoint velocity = [aPanRecognizer velocityInView:aPanRecognizer.view]; NSInteger movement = translation.x - self.draggingPoint.x; - Menu currentMenu; + MenuSide currentMenu; if (self.horizontalLocation > 0) - currentMenu = MenuLeft; + currentMenu = MenuSideLeft; else if (self.horizontalLocation < 0) - currentMenu = MenuRight; + currentMenu = MenuSideRight; else - currentMenu = (translation.x > 0) ? MenuLeft : MenuRight; + currentMenu = (translation.x > 0) ? MenuSideLeft : MenuSideRight; if (![self shouldDisplayMenu:currentMenu forViewController:self.topViewController]) return; @@ -765,7 +765,7 @@ - (void)panDetected:(UIPanGestureRecognizer *)aPanRecognizer // If the speed is high enough follow direction if (positiveVelocity >= MENU_FAST_VELOCITY_FOR_SWIPE_FOLLOW_DIRECTION) { - Menu menu = (velocity.x > 0) ? MenuLeft : MenuRight; + MenuSide menu = (velocity.x > 0) ? MenuSideLeft : MenuSideRight; // Moving Right if (velocity.x > 0) @@ -773,7 +773,7 @@ - (void)panDetected:(UIPanGestureRecognizer *)aPanRecognizer if (currentX > 0) { if ([self shouldDisplayMenu:menu forViewController:self.visibleViewController]) - [self openMenu:(velocity.x > 0) ? MenuLeft : MenuRight withDuration:MENU_QUICK_SLIDE_ANIMATION_DURATION andCompletion:nil]; + [self openMenu:(velocity.x > 0) ? MenuSideLeft : MenuSideRight withDuration:MENU_QUICK_SLIDE_ANIMATION_DURATION andCompletion:nil]; } else { @@ -790,7 +790,7 @@ - (void)panDetected:(UIPanGestureRecognizer *)aPanRecognizer else { if ([self shouldDisplayMenu:menu forViewController:self.visibleViewController]) - [self openMenu:(velocity.x > 0) ? MenuLeft : MenuRight withDuration:MENU_QUICK_SLIDE_ANIMATION_DURATION andCompletion:nil]; + [self openMenu:(velocity.x > 0) ? MenuSideLeft : MenuSideRight withDuration:MENU_QUICK_SLIDE_ANIMATION_DURATION andCompletion:nil]; } } } @@ -799,14 +799,14 @@ - (void)panDetected:(UIPanGestureRecognizer *)aPanRecognizer if (currentXOffset < (self.horizontalSize - self.slideOffset)/2) [self closeMenuWithCompletion:nil]; else - [self openMenu:(currentX > 0) ? MenuLeft : MenuRight withCompletion:nil]; + [self openMenu:(currentX > 0) ? MenuSideLeft : MenuSideRight withCompletion:nil]; } } } - (NSInteger)minXForDragging { - if ([self shouldDisplayMenu:MenuRight forViewController:self.topViewController]) + if ([self shouldDisplayMenu:MenuSideRight forViewController:self.topViewController]) { return (self.horizontalSize - self.slideOffset) * -1; } @@ -816,7 +816,7 @@ - (NSInteger)minXForDragging - (NSInteger)maxXForDragging { - if ([self shouldDisplayMenu:MenuLeft forViewController:self.topViewController]) + if ([self shouldDisplayMenu:MenuSideLeft forViewController:self.topViewController]) { return self.horizontalSize - self.slideOffset; }