I am coding an application that works the same as Apple Weather.app: at the bottom is UIPageControl and UIScrollView in the middle of the screen. In my code, I implemented a method - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView to find out when the user went to a new page. If they go to a new page, I’ll upload the data of neighboring pages to quickly go to the page. (In one example, Apple uses - (void)scrollViewDidScroll:(UIScrollView *)sender , but it causes my application to freeze quickly when loading a new page, so it doesn't work.) This code works very well.
I use scrollRectToVisible: programmatically scroll inside the scroll when the user clicks on the UIPageControl. The problem is that scrollRectToVisible: does not send a notification to UIScrollViewDelegate when scrolling - therefore, the code responsible for loading neighboring pages is never called when using UIPageControl.
Is there a way to get UIScrollView to notify its delegate when it is called by the scrollRectToVisible: method? Or do I need to use threads to prevent my application from freezing?
Thanks!
- Ry
ryyst source share