views:

156

answers:

1

I'd like to create an iPhone app that supports tracing of arbitrary shapes using your finger (with accuracy detection). I have seen references to an Apple sample app called "GestureMatch" that supposedly implemented exactly that, but it was removed from the SDK at some point and I cannot find the source anywhere via Google. Does anyone know of a current official sample that demonstrates tracing like this? Or any solid suggestions on other resources to look at? I've done some iPhone programming, but not really anything with the graphics API's or custom handling of touch gestures, so I'm not sure where to start.

A: 

If you're on 3.1.3 firmware you can use the touchesBegan, touchesChanged, and touchesEnded methods. If you were to do an iPad app on 3.2, you'd have access to gesture recognizers such as UIPanGestureRecognizer - which provides the same basic functionality but also gives you some extra information.

The problem here is that they will not give you a smooth line without some extra work on your part, but these are the basic ways to handle finger tracking.

Unfortunately I don't have any examples to give you, but check out the stuff I mentioned in the developer documentation. You should be able to at least get started from that.

I'm uncertain if gesture recognizers are available in 4.0. Might be worth checking out.

dc
Thanks - I've looked at the API docs already. Handling touches generally isn't the issue, it's how best to compare a traced path to an existing shape and calculating deviance.
bmoeskau