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

TKSwipeRecognizer also needs gestureCompleteEvent #52

Open
qria opened this issue Nov 22, 2016 · 2 comments
Open

TKSwipeRecognizer also needs gestureCompleteEvent #52

qria opened this issue Nov 22, 2016 · 2 comments

Comments

@qria
Copy link

qria commented Nov 22, 2016

TKSwipeRecognizer also needs to fire gestureCompleteEvent when the finger is lifted if the swipe was recognized. This will be very useful in games where swipe is the main control, where you can implement long presses with this. Without this functionality, players have to swipe constantly to move. which is cumbersome to say the least.

I will try to implement it by myself and will make a pull request after finishing it.

@qria
Copy link
Author

qria commented Nov 22, 2016

It was a pretty simple fix since the code is very readable but I have one problem.

I've changed TKSwipeRecognizer to set TKGestureRecognizerState.RecognizedAndStillRecognizing instead of TKGestureRecognizerState.Recognized to wait for TKSwipeRecognizer.touchesEnded(), and it works, but changing the state to TKGestureRecognizerState.Recognized after the press ends fires the gestureRecognizedEvent again. So I set it to TKGestureRecognizerState.FailedOrEnded to not trigger the event again. Is this okay?

@prime31
Copy link
Owner

prime31 commented Nov 22, 2016

That sounds like it will work just fine. The FailedOrEnded state is there for just such occassions.

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