I want to return my content offset to UIScrollView if I am not dragging enough:
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(CGPoint *)targetContentOffset { self.endingOffset = scrollView.contentOffset; if(abs(verticalOffset) > [self cellHeight] / 9) {
The code to return to the starting position is in the rest, and it always works. However, when I do not scroll enough and quickly make a gesture, he leans back. If I scroll a little and then hold this position a little longer than usual, it smoothly returns.
I did not find anything in the API link about how long the user touched UIScrollView, and even if I didnβt do it right away, I could use this to change the behavior of my returning code. I also tried scrolling the position using setContentOffset: animated: but that didn't seem to fix the twitch.
Any ideas?
source share