From 0dd80a3cde85c825a0d550b3ac8e3cfcf7381cbe Mon Sep 17 00:00:00 2001 From: Roman Efimov Date: Sun, 23 Mar 2014 12:02:28 -0700 Subject: [PATCH] Minor refactoring --- REMenu/REMenu.m | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/REMenu/REMenu.m b/REMenu/REMenu.m index e719581..abf651b 100644 --- a/REMenu/REMenu.m +++ b/REMenu/REMenu.m @@ -242,7 +242,6 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view // if (self.bounce) { self.isAnimating = YES; - if ([UIView respondsToSelector:@selector(animateWithDuration:delay:usingSpringWithDamping:initialSpringVelocity:options:animations:completion:)]) { [UIView animateWithDuration:self.animationDuration+self.bounceAnimationDuration delay:0.0 @@ -257,7 +256,6 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view } completion:^(BOOL finished) { self.isAnimating = NO; }]; - } else { [UIView animateWithDuration:self.animationDuration delay:0.0 @@ -272,9 +270,7 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view }]; } - } - else - { + } else { [UIView animateWithDuration:self.animationDuration delay:0.0 options:UIViewAnimationOptionBeginFromCurrentState|UIViewAnimationOptionCurveEaseInOut @@ -296,7 +292,9 @@ - (void)showInView:(UIView *)view - (void)showFromNavigationController:(UINavigationController *)navigationController { - if (self.isAnimating) return; + if (self.isAnimating) { + return; + } self.navigationBar = navigationController.navigationBar; [self showFromRect:CGRectMake(0, 0, navigationController.navigationBar.frame.size.width, navigationController.view.frame.size.height) inView:navigationController.view]; @@ -369,7 +367,7 @@ - (void)close - (CGFloat)combinedHeight { - return self.items.count * self.itemHeight + self.items.count * self.separatorHeight + 40.0 + self.cornerRadius; + return self.items.count * self.itemHeight + self.items.count * self.separatorHeight + 40.0 + self.cornerRadius; } - (void)setNeedsLayout