Skip to content

Commit b590336

Browse files
committed
Fixed issue with pan gestures as well
1 parent 7a8265d commit b590336

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

MMDrawerController/MMDrawerController.m

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -928,8 +928,15 @@ -(void)tapGestureCallback:(UITapGestureRecognizer *)tapGesture{
928928

929929
-(void)panGestureCallback:(UIPanGestureRecognizer *)panGesture{
930930
switch (panGesture.state) {
931-
case UIGestureRecognizerStateBegan:
932-
self.startingPanRect = self.centerContainerView.frame;
931+
case UIGestureRecognizerStateBegan:{
932+
if(self.animatingDrawer){
933+
[panGesture setEnabled:NO];
934+
break;
935+
}
936+
else {
937+
self.startingPanRect = self.centerContainerView.frame;
938+
}
939+
}
933940
case UIGestureRecognizerStateChanged:{
934941
CGRect newFrame = self.startingPanRect;
935942
CGPoint translatedPoint = [panGesture translationInView:self.centerContainerView];
@@ -969,7 +976,6 @@ -(void)panGestureCallback:(UIPanGestureRecognizer *)panGesture{
969976
[self.centerContainerView setCenter:CGPointMake(CGRectGetMidX(newFrame), CGRectGetMidY(newFrame))];
970977
break;
971978
}
972-
case UIGestureRecognizerStateCancelled:
973979
case UIGestureRecognizerStateEnded:{
974980
self.startingPanRect = CGRectNull;
975981
CGPoint velocity = [panGesture velocityInView:self.childControllerContainerView];
@@ -980,6 +986,10 @@ -(void)panGestureCallback:(UIPanGestureRecognizer *)panGesture{
980986
}];
981987
break;
982988
}
989+
case UIGestureRecognizerStateCancelled:{
990+
[panGesture setEnabled:YES];
991+
break;
992+
}
983993
default:
984994
break;
985995
}

0 commit comments

Comments
 (0)