@@ -736,12 +736,15 @@ -(void)viewDidDisappear:(BOOL)animated{
736
736
-(void )willRotateToInterfaceOrientation : (UIInterfaceOrientation)toInterfaceOrientation duration : (NSTimeInterval )duration {
737
737
[super willRotateToInterfaceOrientation: toInterfaceOrientation duration: duration];
738
738
// If a rotation begins, we are going to cancel the current gesture and reset transform and anchor points so everything works correctly
739
- for (UIGestureRecognizer * gesture in self.childControllerContainerView .gestureRecognizers ){
739
+ BOOL gestureInProgress = NO ;
740
+ for (UIGestureRecognizer * gesture in self.view .gestureRecognizers ){
740
741
if (gesture.state == UIGestureRecognizerStateChanged){
741
742
[gesture setEnabled: NO ];
742
743
[gesture setEnabled: YES ];
744
+ gestureInProgress = YES ;
745
+ }
746
+ if (gestureInProgress) {
743
747
[self resetDrawerVisualStateForDrawerSide: self .openSide];
744
- break ;
745
748
}
746
749
}
747
750
for (UIViewController * childViewController in self.childViewControllers ){
@@ -1044,7 +1047,8 @@ -(void)panGestureCallback:(UIPanGestureRecognizer *)panGesture{
1044
1047
[self .centerContainerView setCenter: CGPointMake (CGRectGetMidX (newFrame), CGRectGetMidY (newFrame))];
1045
1048
break ;
1046
1049
}
1047
- case UIGestureRecognizerStateEnded:{
1050
+ case UIGestureRecognizerStateEnded:
1051
+ case UIGestureRecognizerStateCancelled: {
1048
1052
self.startingPanRect = CGRectNull ;
1049
1053
CGPoint velocity = [panGesture velocityInView: self .childControllerContainerView];
1050
1054
[self finishAnimationForPanGestureWithXVelocity: velocity.x completion: ^(BOOL finished) {
@@ -1055,11 +1059,6 @@ -(void)panGestureCallback:(UIPanGestureRecognizer *)panGesture{
1055
1059
self.view .userInteractionEnabled = YES ;
1056
1060
break ;
1057
1061
}
1058
- case UIGestureRecognizerStateCancelled:{
1059
- [panGesture setEnabled: YES ];
1060
- self.view .userInteractionEnabled = YES ;
1061
- break ;
1062
- }
1063
1062
default :
1064
1063
break ;
1065
1064
}
0 commit comments