I'm doing programmatic scrolling in UITableViews with scrollToRowAtIndexPath, which does not trigger scrollViewDidEndDecelerating. What is a good way to detect when this scrolling has completed?
I ask because in my code:
[tableView1 scrollToRowAtIndexPath:indexPath1 atScrollPosition:UITableViewScrollPositionBottom animated:YES];
[tableView2 scrollToRowAtIndexPath:indexPath2 atScrollPosition:UITableViewScrollPositionMiddle animated:YES];
// Additional methods here
occasionally the later, additional methods fire before this scrolling has completed. I'd like to use something more fool-proof than performSelector: afterDelay:.
Have you tried scrollViewDidEndScrollingAnimation:? It may have the same issue as your other delegate method, but it's worth a shot. The docs specifically say it's called at the end of setContentOffset:animated: and scrollRectToVisible:animated:, which I have a hunch may be used to implement scrollToRowAtIndexPath:atScrollPosition:.
Edit: it's been confirmed that scrollViewDidEndScrollingAnimation: gets called at the end of scrollToRowAtIndexPath:atScrollPosition:. Thanks Ian!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With