What is the best way to create a custom “tickle” UIGestureRecognizer?

前端 未结 1 1259
一整个雨季
一整个雨季 2021-01-14 08:15

I would like to create a custom UIGestureRecognizer for a \"tickle\"... in other words, detecting a swipeLeft followed by a swipeRight, twice, without lifting the finger.

相关标签:
1条回答
  • 2021-01-14 09:06

    I know you hesitate to build it from scratch, but tbh, any other way would feel "hacked together".

    Besides, building this particular gesture from scratch will be easy because Ray Wenderlich's gesture recognizer tutorial actual talks about implementing your own custom gesture... Now only that, but he shows you how to implement a tickle gesture!

    Here's a link to his tutorial: http://www.raywenderlich.com/6567/uigesturerecognizer-tutorial-in-ios-5-pinches-pans-and-more

    The part about the tickle gesture is towards the bottom. Feel free to follow his tutorial and learn how to use it, or you can probably just download his sample code and copy/paste his tickle gesture recognizer class.

    Edit: Oops, this question is many months old. Oh well, it has an answer now.

    0 讨论(0)
提交回复
热议问题