From 15619fd4c7512bcab3f99db5edac46b051028709 Mon Sep 17 00:00:00 2001 From: Aryan Ghassemi Date: Mon, 27 Jan 2014 21:33:20 -0800 Subject: [PATCH] - Updating menu frame and transformation when preparing to reveal, to ensure that even when the app launches in landscape mode the rotation is handled as soon as the menu is about to reveal --- SlideMenu/Source/SlideNavigationController.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/SlideMenu/Source/SlideNavigationController.m b/SlideMenu/Source/SlideNavigationController.m index bb73dce..627a382 100644 --- a/SlideMenu/Source/SlideNavigationController.m +++ b/SlideMenu/Source/SlideNavigationController.m @@ -411,14 +411,15 @@ static SlideNavigationController *singletonInstance; UIViewController *removingMenuViewController = (menu == MenuLeft) ? self.rightMenu : self.leftMenu; // If menu is already open don't prepare, unless forcePrepare is set to true - // If already has been added to the view (has superview) it means it has been initialized so avoid reinitializing - if (([self isMenuOpen] && !forcePrepare) || menuViewController.view.superview) + if ([self isMenuOpen] && !forcePrepare) return; - [self.menuRevealAnimator prepareMenuForAnimation:menu]; - [removingMenuViewController.view removeFromSuperview]; [self.view.window insertSubview:menuViewController.view atIndex:0]; + + [self updateMenuFrameAndTransformAccordingToOrientation]; + + [self.menuRevealAnimator prepareMenuForAnimation:menu]; } - (CGFloat)horizontalLocation