We ran into issues where the shadow does not change on rotation.
Possible Solution
For us, we pulled the shadow draw methods up to the root view controller, but here's what we did:
We need to redraw the shadow on rotation.
We added a delegate method that redraws the menu on the completion of a rotation.
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context)
{
} completion:^(id<UIViewControllerTransitionCoordinatorContext> context)
{
if(self.shadowEnabled) [self drawMenuShadows];
}];
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
}
Since we're redrawing the menu at the end of the rotation, and interfaceOrientation is deprecated at iOS 8, we could return only the width and height.
- (CGSize)sizeAdjustedForInterfaceOrientation:(UIView *)view {
return CGSizeMake(view.frame.size.width, view.frame.size.height);
}
We ran into issues where the shadow does not change on rotation.
Possible Solution
For us, we pulled the shadow draw methods up to the root view controller, but here's what we did:
We need to redraw the shadow on rotation.
We added a delegate method that redraws the menu on the completion of a rotation.
Since we're redrawing the menu at the end of the rotation, and
interfaceOrientationis deprecated at iOS 8, we could return only the width and height.- (CGSize)sizeAdjustedForInterfaceOrientation:(UIView *)view { return CGSizeMake(view.frame.size.width, view.frame.size.height); }