【发布时间】:2012-11-07 12:45:09
【问题描述】:
我是 iOS 新手,我在我的项目中使用 UIPanGestureRecognizer。在拖动视图时,我需要获取当前的接触点和上一个接触点。我正在努力获得这两点。
如果我使用touchesBegan 方法而不是使用UIPanGestureRecognizer,我可以通过以下代码得到这两点:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
CGPoint touchPoint = [[touches anyObject] locationInView:self];
CGPoint previous=[[touches anyObject]previousLocationInView:self];
}
我需要在UIPanGestureRecognizer事件触发方法中得到这两点。我怎样才能做到这一点?请指导我。
【问题讨论】:
标签: ios objective-c uipangesturerecognizer uitouch touchesbegan