Skip to content

Commit 93b7afc

Browse files
committed
- Implemented clear for slide animation
- Fixed an issue with scale animation
1 parent a759310 commit 93b7afc

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorScale.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ @implementation SlideNavigationContorllerAnimatorScale
1414

1515
- (id)init
1616
{
17-
if (self = [self initWithMinimumScale:.8])
17+
if (self = [self initWithMinimumScale:.9])
1818
{
1919
}
2020

@@ -39,7 +39,7 @@ - (void)prepareMenuForAnimation:(Menu)menu
3939
? [SlideNavigationController sharedInstance].leftMenu
4040
: [SlideNavigationController sharedInstance].rightMenu;
4141

42-
menuViewController.view.transform = CGAffineTransformScale([SlideNavigationController sharedInstance].view.transform, self.minimumScale, self.minimumScale);
42+
menuViewController.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, self.minimumScale, self.minimumScale);
4343
}
4444

4545
- (void)animateMenu:(Menu)menu withProgress:(CGFloat)progress

SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorSlide.m

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,32 @@ - (void)animateMenu:(Menu)menu withProgress:(CGFloat)progress
102102

103103
- (void)clear
104104
{
105-
// Nothing to do
105+
[self clearMenu:MenuLeft];
106+
[self clearMenu:MenuRight];
107+
}
108+
109+
#pragma mark - Private Method -
110+
111+
- (void)clearMenu:(Menu)menu
112+
{
113+
UIViewController *menuViewController = (menu == MenuLeft)
114+
? [SlideNavigationController sharedInstance].leftMenu
115+
: [SlideNavigationController sharedInstance].rightMenu;
116+
117+
UIInterfaceOrientation orientation= [SlideNavigationController sharedInstance].interfaceOrientation;
118+
119+
CGRect rect = menuViewController.view.frame;
120+
121+
if (UIInterfaceOrientationIsLandscape(orientation))
122+
{
123+
rect.origin.y = 0;
124+
}
125+
else
126+
{
127+
rect.origin.x = 0;
128+
}
129+
130+
menuViewController.view.frame = rect;
106131
}
107132

108133
@end

SlideMenu/Source/SlideNavigationController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ - (void)prepareMenuForReveal:(Menu)menu forcePrepare:(BOOL)forcePrepare
416416
if (([self isMenuOpen] && !forcePrepare) || menuViewController.view.superview)
417417
return;
418418

419-
menuViewController.view.frame = [self initialRectForMenu];
419+
//menuViewController.view.frame = [self initialRectForMenu];
420420
[self.menuRevealAnimator prepareMenuForAnimation:menu];
421421

422422
[removingMenuViewController.view removeFromSuperview];

0 commit comments

Comments
 (0)