在UIResponder API中接触 [英] getting touches in UIResponder API

查看:71
本文介绍了在UIResponder API中接触的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,UIResponder有以下方法:

   - (void)touchesBegan:(NSSet *)touches withEvent: )事件

我的问题是, c $ c>参数和 [event allTouches]

解决方案



如果您通过[event allTouches]进行搜索,并将它们与[touches anyObject]中的UITouch进行比较, ,你会找到一个匹配。


So, UIResponder has methods like:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

My question is, what's the difference between the touches parameter, and [event allTouches]?

解决方案

All sets of touches are stored within event.

However, for convenience Apple separately provides the touch that triggered the touchesBegan method to be invoked as a parameter.

If you searched through [event allTouches] and compared them to the UITouch within [touches anyObject], you would find a match.

这篇关于在UIResponder API中接触的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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