@@ -48,6 +48,7 @@ @implementation SlideNavigationController
4848NSString *const SlideNavigationControllerDidReveal = @" SlideNavigationControllerDidReveal" ;
4949
5050#define MENU_SLIDE_ANIMATION_DURATION .3
51+ #define MENU_SLIDE_ANIMATION_OPTION UIViewAnimationOptionCurveEaseOut
5152#define MENU_QUICK_SLIDE_ANIMATION_DURATION .18
5253#define MENU_IMAGE @" menu-button"
5354#define MENU_SHADOW_RADIUS 10
@@ -108,6 +109,8 @@ - (void)setup
108109
109110singletonInstance = self;
110111
112+ self.menuRevealAnimationDuration = MENU_SLIDE_ANIMATION_DURATION;
113+ self.menuRevealAnimationOption = MENU_SLIDE_ANIMATION_OPTION;
111114self.landscapeSlideOffset = MENU_DEFAULT_SLIDE_OFFSET;
112115self.portraitSlideOffset = MENU_DEFAULT_SLIDE_OFFSET;
113116self.panGestureSideOffset = 0 ;
@@ -230,9 +233,9 @@ - (void)switchToViewController:(UIViewController *)viewController
230233{
231234if (slideOutAnimation)
232235{
233- [UIView animateWithDuration: (slideOutAnimation) ? MENU_SLIDE_ANIMATION_DURATION : 0
236+ [UIView animateWithDuration: (slideOutAnimation) ? self .menuRevealAnimationDuration : 0
234237 delay: 0
235- options: UIViewAnimationOptionCurveEaseOut
238+ options: self .menuRevealAnimationOption
236239 animations: ^{
237240 CGFloat width = self.horizontalSize ;
238241 CGFloat moveLocation = (self.horizontalLocation > 0 ) ? width : -1 *width;
@@ -285,12 +288,12 @@ - (void)popAllAndSwitchToViewController:(UIViewController *)viewController
285288
286289- (void )closeMenuWithCompletion : (void (^)())completion
287290{
288- [self closeMenuWithDuration: MENU_SLIDE_ANIMATION_DURATION andCompletion: completion];
291+ [self closeMenuWithDuration: self .menuRevealAnimationDuration andCompletion: completion];
289292}
290293
291294- (void )openMenu : (Menu)menu withCompletion : (void (^)())completion
292295{
293- [self openMenu: menu withDuration: MENU_SLIDE_ANIMATION_DURATION andCompletion: completion];
296+ [self openMenu: menu withDuration: self .menuRevealAnimationDuration andCompletion: completion];
294297}
295298
296299- (void )toggleLeftMenu
@@ -465,7 +468,7 @@ - (void)openMenu:(Menu)menu withDuration:(float)duration andCompletion:(void (^)
465468
466469[UIView animateWithDuration: duration
467470 delay: 0
468- options: UIViewAnimationOptionCurveEaseOut
471+ options: self .menuRevealAnimationOption
469472 animations: ^{
470473 CGRect rect = self.view .frame ;
471474 CGFloat width = self.horizontalSize ;
@@ -488,7 +491,7 @@ - (void)closeMenuWithDuration:(float)duration andCompletion:(void (^)())completi
488491
489492[UIView animateWithDuration: duration
490493 delay: 0
491- options: UIViewAnimationOptionCurveEaseOut
494+ options: self .menuRevealAnimationOption
492495 animations: ^{
493496 CGRect rect = self.view .frame ;
494497 rect.origin .x = 0 ;
0 commit comments