Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable velocity horizontal direction check when gesture touch moved #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions ZFDragableModalTransition/ZFModalTransitionAnimator.m
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
}

if (self.state == UIGestureRecognizerStateFailed) return;
CGPoint velocity = [self velocityInView:self.view];
CGPoint nowPoint = [touches.anyObject locationInView:self.view];
CGPoint prevPoint = [touches.anyObject previousLocationInView:self.view];

Expand All @@ -542,7 +541,7 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event

CGFloat topVerticalOffset = -self.scrollview.contentInset.top;

if ((fabs(velocity.x) < fabs(velocity.y)) && (nowPoint.y > prevPoint.y) && (self.scrollview.contentOffset.y <= topVerticalOffset)) {
if ((nowPoint.y > prevPoint.y) && (self.scrollview.contentOffset.y <= topVerticalOffset)) {
self.isFail = @NO;
} else if (self.scrollview.contentOffset.y >= topVerticalOffset) {
self.state = UIGestureRecognizerStateFailed;
Expand Down