iphone用手指运动识别不同的形状
我正在为iPhone开发一个应用程序,我希望在手指在iPhone表面移动时检测不同的形状。任何人都可以帮助我,如何在iPhone sdk中通过手指移动或手势检测不同的几何形状。
I'm developing an application for iPhone, and I want to detect different shapes as my fingers move on iPhone surface. Can anybody help me, how can I detect the different geometric shapes via finger movement or gesture in iPhone sdk.
你可以做它,但这不是一件容易的事。 iPhone SDK提供 UIGestureRecognizer 课程,你可以创建一个UIGestureRecognizer的子类,它识别一个独特的手势或角色(在你的情况下)。
You can do it, but it's not an easy task. iPhone SDK provides UIGestureRecognizer class, you may create a subclass that UIGestureRecognizer that recognizes a distinctive gesture or character (in your case).
但是还有另一种方法。其中一个由Brit Gardner在他的博客中描述一>。这种方法的基础是基于JavaScript的N-Dollar识别器。这家伙做得很好,现在你可以使用 MultistrokeGestureRecognizer-iOS 库检测符号和形状。当然,这个库并不完美,它使用特定的方式(如JSON)来识别触摸,但它总比没有好。
But there is also another approaches. One of them described by Brit Gardner in his blog. Underlying this approach is the N-Dollar Recognizer based on JavaScript. This guy had done a nice job and now you can use MultistrokeGestureRecognizer-iOS library for detecting symbols and shapes. Of course, this library is not perfect and it use specific way (like JSON) to recognize touches, but it's better than nothing.
谢谢,希望对某人有所帮助。
Thanks, hope this help someone.