zhuber
zhuber

Reputation: 5524

Infinite vertical scrollView with loading

Are there any examples of infinite vertical scrollview, something like Facebook and 9gag app. When you scroll it shows for example pictures, but it stops after lets say 10 pictures showing refresh/loading indicator, and then loading new pictures (so it doesn't have to download all pics at app start).

Thanks.

Upvotes: 0

Views: 586

Answers (2)

SAMIR RATHOD
SAMIR RATHOD

Reputation: 3510

when user scroll upside then it call the following method

 #pragma mark -
 #pragma mark - Scroll View Delegate Method

    - (void) scrollViewDidScroll:(UIScrollView *)scrollView {
       if (scrollView == scrollObj) {
            CGFloat scrollPosition = scrollObj.contentSize.height - scrollObj.frame.size.height - scrollObj.contentOffset.y;
            if (scrollPosition < 30)
            {
                if ((!spinnerBottom.isAnimating) ) {
                    [spinnerBottom startAnimating];
                    [self getAPICall]; //your apicall function 
                }
            }
        }
    }

Upvotes: 0

andreag
andreag

Reputation: 881

This amazing dev has made it easy to add infinite scroll with a UIScrollView category. You should probably give it a try.

Upvotes: 1

Related Questions