Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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

UIGestureRecognizer. Don’t roll your own.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top