是否可以从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有优秀的文档,使用它!