Iphone recognizes different shapes with a flick of a finger

I am developing an application for the iPhone, and I want to detect different shapes as my fingers move across the surface of the iPhone. Can someone help me, how can I detect various geometric shapes using a finger movement or a gesture in iPhone sdk.

+7
source share
3 answers

You can do it, but it is not an easy task. The iPhone SDK provides the UIGestureRecognizer class, you can subclass the UIGestureRecognizer that recognizes a distinctive gesture or character (in your case).

But there are other approaches. One of them is described by Brit Gardner on his blog . This approach is based on JavaScript-based N-Dollar recognizer. This guy did a good job, and now you can use the MultistrokeGestureRecognizer-iOS library to detect characters and shapes. Of course, this library is not ideal, and it uses a certain method (for example, JSON) to recognize strokes, but it is better than nothing.

Thanks, hope this helps someone.

+4
source

There is a sample user-defined UIGestureRecognizer built into the iOS SDK documentation that recognizes a checkmark here , in particular in the section "Creating an individual gesture" Recognizers "(you could not find an easy way to directly connect the section). Using this as a template, you must write your own recognizer gestures to correctly recognize your gesture.

The part that you will have to provide yourself is the code that defines for your device what exactly this means in order to make your particular form of interest.

By the way, I am also writing my own custom UIGestureRecognizer as an example of continuous gesture recognition as opposed to discrete check mark recognition, as I would appreciate an example of this earlier.

It is available on Github.

+2
source

In 2009, Daniele Margutti created the MCGestureRecognizer project, also based on http://depts.washington.edu/aimgroup/proj/dollar/

If you can find this, it will give you a great heads-up, but most likely you will need to upgrade to ios5. It used to be at http://www.malcom-mac.com , but this site does not seem to work.

0
source

All Articles