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

How to not show pull to refresh when data source is ended. #13

Open
sairasamdanii opened this issue Oct 27, 2014 · 1 comment
Open

How to not show pull to refresh when data source is ended. #13

sairasamdanii opened this issue Oct 27, 2014 · 1 comment

Comments

@sairasamdanii
Copy link

When all my data source is ended now I don't want this refresh control to appear no matter how many times user scrolls down. I have kept a bool to mark end of datasource. But pulltoRefresh sticks at end of my table view showing Loading with activity indicator.
This is how my code looks like

  • (void)bottomPullToRefreshTriggered:(MNMBottomPullToRefreshManager *)manager {
    if (!self.dataSourceEnded) {
    [self performSelector:@selector(loadTable) withObject:nil afterDelay:0.1];
    }
    else {
    [pullToRefreshManager_ tableViewReloadFinished];
    }
    }
@firstpixel
Copy link

Hi Sairasamdanii,

What I did is add a condition on the loadTable:
So when the result data is less than total data to download I will keep the PTRV visible or else I set visible to NO.

- (void)loadTable {
    reloads_++;
    [_tableView reloadData];
    [pullToRefreshManager_ tableViewReloadFinished];
    if (myTableViewContentArray.count < myContentTotal) {
       [pullToRefreshManager_ setPullToRefreshViewVisible:YES];
    }else{
        [pullToRefreshManager_ setPullToRefreshViewVisible:NO];
    }
}

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

2 participants