diff --git a/ECSlidingViewController/FirstTopViewController.m b/ECSlidingViewController/FirstTopViewController.m index ed71d4c..7c31e6a 100644 --- a/ECSlidingViewController/FirstTopViewController.m +++ b/ECSlidingViewController/FirstTopViewController.m @@ -14,12 +14,11 @@ { [super viewWillAppear:animated]; - self.view.layer.shadowOffset = CGSizeZero; + // shadowPath, shadowOffset, and rotation is handled by ECSlidingViewController. + // You just need to set the opacity, radius, and color. self.view.layer.shadowOpacity = 0.75f; self.view.layer.shadowRadius = 10.0f; self.view.layer.shadowColor = [UIColor blackColor].CGColor; - self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.layer.bounds].CGPath; - self.view.clipsToBounds = NO; if (![self.slidingViewController.underLeftViewController isKindOfClass:[MenuViewController class]]) { self.slidingViewController.underLeftViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Menu"]; @@ -32,18 +31,6 @@ [self.view addGestureRecognizer:self.slidingViewController.panGesture]; } -- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration -{ - self.view.layer.shadowPath = nil; - self.view.layer.shouldRasterize = YES; -} - -- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation -{ - self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.layer.bounds].CGPath; - self.view.layer.shouldRasterize = NO; -} - - (IBAction)revealMenu:(id)sender { [self.slidingViewController anchorTopViewTo:ECRight]; diff --git a/ECSlidingViewController/Vendor/ECSlidingViewController/ECSlidingViewController.m b/ECSlidingViewController/Vendor/ECSlidingViewController/ECSlidingViewController.m index a6fd1c0..d20e895 100644 --- a/ECSlidingViewController/Vendor/ECSlidingViewController/ECSlidingViewController.m +++ b/ECSlidingViewController/Vendor/ECSlidingViewController/ECSlidingViewController.m @@ -103,6 +103,8 @@ NSString *const ECSlidingViewTopDidReset = @"ECSlidingViewTopDidReset"; [_topViewController.view setAutoresizingMask:self.autoResizeToFillScreen]; [_topViewController.view setFrame:self.view.bounds]; + _topViewController.view.layer.shadowOffset = CGSizeZero; + _topViewController.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.layer.bounds].CGPath; [self.view addSubview:_topViewController.view]; } @@ -187,6 +189,9 @@ NSString *const ECSlidingViewTopDidReset = @"ECSlidingViewTopDidReset"; - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { + self.topView.layer.shadowPath = nil; + self.topView.layer.shouldRasterize = YES; + if(![self topViewHasFocus]){ [self removeTopViewSnapshot]; } @@ -195,6 +200,9 @@ NSString *const ECSlidingViewTopDidReset = @"ECSlidingViewTopDidReset"; } - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{ + self.topView.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.layer.bounds].CGPath; + self.topView.layer.shouldRasterize = NO; + if(![self topViewHasFocus]){ [self addTopViewSnapshot]; }