Is there a high-level gestures library for iPhone development?

喜欢而已 提交于 2019-12-03 04:36:50

问题


The iPhone platform has a number of common gesture idioms. For example, there are taps, pinches, and swipes, each with varying number of fingers. But when you're developing an app, it's up to you to implement these things based on low-level information about the number and locations of touches. It seems like this is a prime candidate for a library. You would register a delegate, set some parameters like multi-tap interval and swipe threshold, and get calls like swipeStarted/Ended, pinchStarted/Ended, multiTap, etc. Does such a library exist?


回答1:


I've set up just such a project. It's not a library, but it is full of sample code for pinch/stretch, tap and hold, etc.

Blog:

http://6tringle.com/blog/2009/TouchSampleCode.html

Github:

http://github.com/kailoa/6tringle-touchsamplecode/tree/master




回答2:


Here is one for detecting the circle gesture, with the source code provided. Might be useful for adapting it to detect other geatures.

http://iphonedevelopment.blogspot.com/2009/04/detecting-circle-gesture.html




回答3:


UIGestureRecognizer. Don’t roll your own.




回答4:


I forked Kailoa's very nice example and attempted to create a library.

http://github.com/bentford/GestureDetect

I intend to add a combination "pinch-zoom and drag" gesture like the one in the maps app. Once I get it working, I'll post on github.



来源:https://stackoverflow.com/questions/907512/is-there-a-high-level-gestures-library-for-iphone-development

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!