如何在我的触摸开始事件中仅访问我的触摸之一
我有:
UITouch *touch = [touches anyObject];
if ([touches count] == 2) {
//preforming actions
}
我想要做的是在 if 语句内询问它,其中两次触摸是分开的。
I have:
UITouch *touch = [touches anyObject];
if ([touches count] == 2) {
//preforming actions
}
What I want to do Is ask it inside of the if
statement where the two touches are seperatly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以迭代触摸:
编辑:如果您想要找到两个触摸之间的距离,并且您知道恰好有两个触摸,您可以分别抓取每个触摸,然后进行一些数学运算。例子:
You can iterate over the touches:
Edit: if you want to, say, find the distance between the two touches, and you know there are exactly two, you can grab each separately then do some math. Example:
Touches 已经是一个数组了。无需将它们复制到另一个数组中 - 只需使用 [touches objectAtIndex:n] 即可访问 touch n。
Touches is already an array. There's no need to copy them into another array -- just use [touches objectAtIndex:n] to access touch n.