gpt4 book ai didi

iphone - UISwipeGestureRecognizer 手势起点

转载 作者:太空狗 更新时间:2023-10-30 03:59:12 28 4
gpt4 key购买 nike

是否可以从 UISwipeGestureRecognizer 获取手势起点。就像它在

中的可能性
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

UITouch * touch = [touches anyObject];
gestureStartPoint = [touch locationInView:self];
}

最佳答案

根据UISwipeGestureRecognizer documentation你可以:

You may determine the location where a swipe began by calling the UIGestureRecognizer methods locationInView: and locationOfTouch:inView:. The former method gives you the centroid if more than one touch was involved in the gesture; the latter gives the location of a particular touch.

PS:你真的应该先看看文档,答案在UISwipeGestureRecognizer的类引用中,应该不难找到。作为开发人员的一部分是能够查找事物,Apple 拥有出色的文档,请使用它!

关于iphone - UISwipeGestureRecognizer 手势起点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3830836/

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