开发者

Create Circular Path for an iPhone Application

开发者 https://www.devze.com 2023-01-25 01:46 出处:网络
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 recogni

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消