Setting contentOffset programmatically triggers scrollViewDidScroll
It is possible to change the content offset of a UIScrollView
without triggering the delegate callback scrollViewDidScroll:
, by setting the bounds of the UIScrollView
with the origin set to the desired content offset.
CGRect scrollBounds = scrollView.bounds;scrollBounds.origin = desiredContentOffset;scrollView.bounds = scrollBounds;
Try
id scrollDelegate = scrollView.delegate;scrollView.delegate = nil;scrollView.contentOffset = point;scrollView.delegate = scrollDelegate;
Worked for me.
What about using existing properties of UIScrollView?
if(scrollView.isTracking || scrollView.isDragging || scrollView.isDecelerating) { //your code}