@@ -736,12 +736,15 @@ -(void)viewDidDisappear:(BOOL)animated{
736736-(void )willRotateToInterfaceOrientation : (UIInterfaceOrientation)toInterfaceOrientation duration : (NSTimeInterval )duration {
737737 [super willRotateToInterfaceOrientation: toInterfaceOrientation duration: duration];
738738 // 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 ){
740741 if (gesture.state == UIGestureRecognizerStateChanged){
741742 [gesture setEnabled: NO ];
742743 [gesture setEnabled: YES ];
744+ gestureInProgress = YES ;
745+ }
746+ if (gestureInProgress) {
743747 [self resetDrawerVisualStateForDrawerSide: self .openSide];
744- break ;
745748 }
746749 }
747750 for (UIViewController * childViewController in self.childViewControllers ){
@@ -1044,7 +1047,8 @@ -(void)panGestureCallback:(UIPanGestureRecognizer *)panGesture{
10441047 [self .centerContainerView setCenter: CGPointMake (CGRectGetMidX (newFrame), CGRectGetMidY (newFrame))];
10451048 break ;
10461049 }
1047- case UIGestureRecognizerStateEnded:{
1050+ case UIGestureRecognizerStateEnded:
1051+ case UIGestureRecognizerStateCancelled: {
10481052 self.startingPanRect = CGRectNull;
10491053 CGPoint velocity = [panGesture velocityInView: self .childControllerContainerView];
10501054 [self finishAnimationForPanGestureWithXVelocity: velocity.x completion: ^(BOOL finished) {
@@ -1055,11 +1059,6 @@ -(void)panGestureCallback:(UIPanGestureRecognizer *)panGesture{
10551059 self.view .userInteractionEnabled = YES ;
10561060 break ;
10571061 }
1058- case UIGestureRecognizerStateCancelled:{
1059- [panGesture setEnabled: YES ];
1060- self.view .userInteractionEnabled = YES ;
1061- break ;
1062- }
10631062 default :
10641063 break ;
10651064 }
0 commit comments