I had a problem creating a pull mechanism for updating at the bottom of the scroll. The code works perfectly smoothly in iOS7, but in iOS8 scrollview jumps instantly and then animates to the correct position.
I keep track of the scroll until it is full of rubber outside of kPullToRefreshHeightPX (in my case it is 40px) and set the flag to be inserted into release and start updating the content.
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
if (_webShouldInsetScrollView == NO && (scrollView.contentOffset.y > ((scrollView.contentSize.height - scrollView.frame.size.height) + kPullToRefreshHeightPX)))
{
_webShouldInsetScrollView = YES;
}
}
If we pulled the drag out of our update distance at the end, we insert (and run our small update animation) and show the next page of results.
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{
if (_webShouldInsetScrollView)
{
[UIView animateWithDuration:0.2 animations:^{
[scrollView setContentInset:UIEdgeInsetsMake(0.0f, 0.0f, kPullToRefreshHeightPX, 0.0f)];
} completion:^(BOOL finished) {
}];
[self performSelector:@selector(showNextResultsPage) withObject:nil afterDelay:1.0f];
}
}
UIScrollViews iOS8, automaticallyAdjustsScrollViewInsets, false iOS7, true iOS8, . - ?