简体   繁体   中英

Create Circular Path for an iPhone Application

如何在iPhone应用程序中创建可以检测手指触摸的圆形路径?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM