I found a post on here that briefly described how to tell if a UIScrollView has finished scrolling How to know exactly when a UIScrollView's scrolling has stopped?. It uses the scrollViewDidEndDragging function and as specified in the UIScrollView documentation and post mentioned above, the willDecelerate:(BOOL)decelerate parameter to tell when the scroll has stopped. However, I still can't seem to get this code snippet to work:
-(void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{
NSLog(@"%d", decelerate);
if (!decelerate)
{
isScrolling = NO;
}
isScrolling = YES;
}
I confirm that the function is being executed with the NSLog but even after I let go and scrolling is finished decelerate is still equal to 1. Why is this?