n8gray
n8gray

Reputation: 4959

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

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?

Upvotes: 8

Views: 2980

Answers (4)

Evadne Wu
Evadne Wu

Reputation: 3200

UIGestureRecognizer. Don’t roll your own.

Upvotes: 2

bentford
bentford

Reputation: 33406

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.

Upvotes: 0

amattn
amattn

Reputation: 10065

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

Upvotes: 6

erotsppa
erotsppa

Reputation: 1751

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

Upvotes: 2

Related Questions