Skip to content

Commit

Permalink
Cleaned up PR #288
Browse files Browse the repository at this point in the history
  • Loading branch information
kcharwood committed Mar 17, 2015
1 parent ed3d0b4 commit 49515c5
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions MMDrawerController/MMDrawerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,7 @@ -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrien
[self resetDrawerVisualStateForDrawerSide:self.openSide];
}
}
if ([self needsManualForwardingOfRotationEvents])
{
if ([self needsManualForwardingOfRotationEvents]){
for(UIViewController * childViewController in self.childViewControllers){
[childViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
}
Expand Down Expand Up @@ -794,8 +793,7 @@ -(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInter
}
}

if ([self needsManualForwardingOfRotationEvents])
{
if ([self needsManualForwardingOfRotationEvents]){
for(UIViewController * childViewController in self.childViewControllers){
[childViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
}
Expand All @@ -808,10 +806,7 @@ -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfac

-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
self.startingPanRect = self.centerContainerView.frame; //

if ([self needsManualForwardingOfRotationEvents])
{
if ([self needsManualForwardingOfRotationEvents]){
for(UIViewController * childViewController in self.childViewControllers){
[childViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
}
Expand Down Expand Up @@ -1138,6 +1133,12 @@ -(void)setNeedsStatusBarAppearanceUpdateIfSupported{
}
}

#pragma mark - iOS 8 Rotation Helpers
- (BOOL)needsManualForwardingOfRotationEvents{
BOOL isIOS8 = (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_7_1);
return !isIOS8;
}

#pragma mark - Animation helpers
-(void)finishAnimationForPanGestureWithXVelocity:(CGFloat)xVelocity completion:(void(^)(BOOL finished))completion{
CGFloat currentOriginX = CGRectGetMinX(self.centerContainerView.frame);
Expand Down Expand Up @@ -1366,12 +1367,6 @@ -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveT
}
}

- (BOOL)needsManualForwardingOfRotationEvents
{
BOOL beforeIOS8 = ([[[UIDevice currentDevice] systemVersion] compare:@"8.0" options:NSNumericSearch] == NSOrderedAscending);
return beforeIOS8;
}

#pragma mark Gesture Recogizner Delegate Helpers
-(MMCloseDrawerGestureMode)possibleCloseGestureModesForGestureRecognizer:(UIGestureRecognizer*)gestureRecognizer withTouch:(UITouch*)touch{
CGPoint point = [touch locationInView:self.childControllerContainerView];
Expand Down

0 comments on commit 49515c5

Please sign in to comment.