@@ -97,23 +97,17 @@ - (void)setup
9797 self.avoidSwitchingToSameClassViewController = YES ;
9898 singletonInstance = self;
9999 self.delegate = self;
100-
101- self.view .layer .shadowColor = [UIColor darkGrayColor ].CGColor ;
102- self.view .layer .shadowRadius = MENU_SHADOW_RADIUS;
103- self.view .layer .shadowOpacity = MENU_SHADOW_OPACITY;
104- self.view .layer .shadowPath = [UIBezierPath bezierPathWithRect: self .view.bounds].CGPath ;
105- self.view .layer .shouldRasterize = YES ;
106- self.view .layer .rasterizationScale = [UIScreen mainScreen ].scale ;
107-
108- [self setEnableSwipeGesture: YES ];
100+ self.enableShadow = YES ;
101+ self.enableSwipeGesture = YES ;
109102}
110103
111104- (void )viewWillLayoutSubviews
112105{
113106 [super viewWillLayoutSubviews ];
114107
115- // Update shadow size
116- self.view .layer .shadowPath = [UIBezierPath bezierPathWithRect: self .view.bounds].CGPath ;
108+ // Update shadow size of enabled
109+ if (self.enableShadow )
110+ self.view .layer .shadowPath = [UIBezierPath bezierPathWithRect: self .view.bounds].CGPath ;
117111}
118112
119113- (void )willRotateToInterfaceOrientation : (UIInterfaceOrientation)toInterfaceOrientation duration : (NSTimeInterval )duration
@@ -292,6 +286,24 @@ - (BOOL)isMenuOpen
292286 return (self.horizontalLocation == 0 ) ? NO : YES ;
293287}
294288
289+ - (void )setEnableShaddow : (BOOL )enable
290+ {
291+ if (enable)
292+ {
293+ self.view .layer .shadowColor = [UIColor darkGrayColor ].CGColor ;
294+ self.view .layer .shadowRadius = MENU_SHADOW_RADIUS;
295+ self.view .layer .shadowOpacity = MENU_SHADOW_OPACITY;
296+ self.view .layer .shadowPath = [UIBezierPath bezierPathWithRect: self .view.bounds].CGPath ;
297+ self.view .layer .shouldRasterize = YES ;
298+ self.view .layer .rasterizationScale = [UIScreen mainScreen ].scale ;
299+ }
300+ else
301+ {
302+ self.view .layer .shadowOpacity = 0 ;
303+ self.view .layer .shadowRadius = 0 ;
304+ }
305+ }
306+
295307#pragma mark - Override Methods -
296308
297309- (NSArray *)popToRootViewControllerAnimated : (BOOL )animated
0 commit comments