Closed Nonepse closed 8 years ago
Tahnks. I think that better option would be to add just Cancelled and Failed state and handle it calling [self cancelInteractiveTransition];
, this would be safer for future purpose.
That's actually what I tried first, but it doesn't seem to work. Am I missing something?
Have you tried to recognier.enabled = NO
, then [self cancelInteractiveTransition];
and recognizer.enabled = YES
, and additionally handle Cancel, and Failure states ?
The following code doesn't fix the bug.
if (recognizer.state == UIGestureRecognizerStateFailed || recognizer.state == UIGestureRecognizerStateCancelled) {
[self cancelInteractiveTransition];
} else if (recognizer.state == UIGestureRecognizerStateBegan) {
if ([self shouldFailGestureRecognizerForDismissDirection:dismissDirection location:location presentingView:presentingView]) {
recognizer.enabled = NO;
[self cancelInteractiveTransition];
recognizer.enabled = YES;
return;
}
self.panGestureRecognizerStartLocation = location;
self.sourceViewInitialFrame = presentingView.frame;
[viewController dismissViewControllerAnimated:YES completion:nil];
}
Is that what you meant?
Hmm okay, i will merge this and i hope that this will not break something else, i forgot i failing recognizer is necessary.
Thanks anyway!.
https://github.com/m1entus/MZFormSheetPresentationController/issues/58
I don't think it's necessary to disable the recognizer if
shouldFailGestureRecognizerForDismissDirection:location:presentingView:
returnsYES
.As per Apple documentation:
A recognizer in a cancelled state is not handled by
handleEdgeDismissalPanGestureRecognizer:dismissDirection:forPresentingView:fromViewController: