哇,多么古老的问题,但无论如何这里是答案。
scrollView.delegate = self; // or some .m file
然后在执行中
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
NSLog(@"Just a usual drag!");
}
- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView {
// so when dragged quickly, this function will be called instead of didEndDragging
// now lets trick it to stop the animation of decelerating
[scrollView setContentOffset:[scrollView contentOffset] animated:NO];
// and then call the dragging event like nothing even happened
[scrollView.delegate scrollViewDidEndDragging:scrollView willDecelerate:NO];
}