gpt4 book ai didi

ios - "(NSSet *)touches"中 "event.allTouches"和 "touchesBegan:withEvent:"的区别

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:18:19 25 4
gpt4 key购买 nike

我需要移动、旋转和缩放 UIImageView 对象。在方法中...

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

我必须使用哪些触摸?

(NSSet *)touches

event.allTouches

换句话说,我的触摸在哪里?

最佳答案

作为参数传递的

touches 是您 View 中的触摸。

event.allTouches 包含事件的所有触摸,甚至是未在您的 View 中开始的触摸。

不要犹豫read the Event Handling Guide for iOS在 Apple 的文档中,它用一些图片进行了解释,它可能会帮助您更好地理解。

特别是the difference between the touches in the parameters and event.allTouches is described here ;)

关于ios - "(NSSet *)touches"中 "event.allTouches"和 "touchesBegan:withEvent:"的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7532039/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com