我的代码:
[self.scrollView.panGestureRecognizer addTarget:self action:@selector(handlePanForScrollView:)];
- (void)handlePanForScrollView:(UIPanGestureRecognizer *)gesture {
switch (gesture.state) {
case UIGestureRecognizerStateBegan:
startScrollPoint = [gesture locationInView:self.scrollView];
break;
case UIGestureRecognizerStateEnded: {
NSLog(@"end");
}
default:
;
break;
}
}
开始状态正常。但是我的NSLog
在滚动时始终显示我的end
(因为状态已更改)。如何正确地检测手势识别器的结束状态?