How can I create a circular path in my iPhone application on which I can detec开发者_StackOverflow中文版t finger touches?
You could use a $1 gesture recognizer. There is an open source gesture recognizer for the iPhone here that was created by Adam Preble.
You use one aspect of the recognizer to predefine shapes. Once the shapes are defined and stored with your application, you can use the recognizer to test if touch strokes match any of your defined shapes.
I use code adapted from Adam's to recognize 6 different gestures in my application (circle, S, squiggle...), and I am happy with the results.
It might be a lot of work for one shape, although the benefits of using a $1 gesture recognizer is that it would recognize any size circle drawn clockwise or counter-clockwise.
精彩评论