Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable infinite scroll indicator #44

Closed
shoujs opened this issue Jul 19, 2012 · 5 comments
Closed

disable infinite scroll indicator #44

shoujs opened this issue Jul 19, 2012 · 5 comments

Comments

@shoujs
Copy link

shoujs commented Jul 19, 2012

Is it possible to disable infinite scroll indicator if an exception occurs?

@samvermette
Copy link
Owner

@shoujs what do you mean an exception? If there's no more data to load for instance? Yes you can disable infinite scrolling by setting tableView.showsInfiniteScrolling to NO.

@shoujs
Copy link
Author

shoujs commented Jul 23, 2012

I mean a network error. The indicator is still animating while a network error happens. Is there a way to stop animating?

@samvermette
Copy link
Owner

@shoujs ah, good call. I haven't planned for that. In the meantime you can probably make it stop by using the code I wrote in the previous comment. Will push a fix shortly that adds a stopAnimating method for the infinite scrolling.

@bosky101
Copy link

bosky101 commented Sep 6, 2012

UPDATE: just saw @samvermette answered this already above. Neat lib!

I am able to stop the infinity scrolling in the following manner

// reference code: SVViewController.m
- (void) viewDidLoad{ 
     // .... your regular code....

     // this was where you setup the call
     [self.tableView addInfiniteScrollingWithActionHandler:^{
          [self didAskToLoadMoreData];
     }];
 }

- (void) didAskToLoadMoreData{
    // simulate making a async request . once you have the data, call didLoadMoreData
    [self performSelector:@selector(didLoadMoreData) withObject:nil afterDelay:2];
}

 - (void) didLoadMoreData{
    tableView.showsInfiniteScrolling = NO;  // stops animating
    tableView.showsInfiniteScrolling = YES; // re-enables infinite scrolling
 }

~B

@samvermette
Copy link
Owner

Setting showsInfiniteScrolling to NO will now hide the activity indicator as well with my last commits. Sorry it took so long to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants