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

[BUG] Horizontal swipe not recognized if there was an arbitraty dragging before #67

Closed
Deepscorn opened this issue Jan 3, 2018 · 3 comments

Comments

@Deepscorn
Copy link

Deepscorn commented Jan 3, 2018

Repro:

  1. Create a scrollview
  2. Init horizontal swipe (TKSwipeRecognizer)
  3. Unset triggerWhenCriteriaMet (see details [BUG] Horizontal swipe recognized without pointer up #66)
  4. Hold the left mouse button and drag slowly from left to right, then from right to left (for example). Then make a fast drag and only now release the button.

Result:
recognizer do not fire gestureRecognizedEvent

Expected behaviour:
recognizer fires gestureRecognizedEvent. That's how it works in vkontakte app when watching photo album for example.

Why is that important:
User may just dragged a bit before swiping because he is inside the bus which makes him shake from time to time

@prime31
Copy link
Owner

prime31 commented Jan 3, 2018

If you look at the code this is the expected behavior. The definition of a swipe is a touch with a move in a specific direction. The instant you change directions it is no longer a swipe and is just random dragging.

@prime31 prime31 closed this as completed Jan 3, 2018
@Deepscorn
Copy link
Author

Just to be sure you understand me:
I did a fast move in a specific direction (1) and successfully received swipe event.
But if I make random dragging and then (not releasing the mouse button) will do (1) - I do not receive swipe

@prime31
Copy link
Owner

prime31 commented Jan 3, 2018

Precisely correct. The instant you change direction it is no longer a swipe. Now you can certainly make a custom gesture recognizer that looks for any movement in a direction of a specific length regardless of previous input but it wouldn't be a swipe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants