iphone用手指运动识别不同的形状 [英] iphone recognize different shapes with finger movement

查看:107
本文介绍了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.

这篇关于iphone用手指运动识别不同的形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆