uzysjung / UzysCircularProgressPullToRefresh

Give Pinterest Like PullToRefresh to any UIScrollView with just simple code
MIT License
340 stars 51 forks source link

add state UZYSPullToRefreshStateCanFinish to fix trigger multiple times when pull quickly and action quickly #8

Closed ivoryxiong closed 10 years ago

ivoryxiong commented 10 years ago

in sample project, when RefreshActionHandler is not insertRowAtTop but reloadTableViewData , which logic just like :

- (void)reloadTableViewData {
    __weak typeof(self) weakSelf = self;
    [[HttpManager sharedManager] Get:@"http://example.com/api/list"
                      successHandler:^(id data) {
                          [weakSelf.tableView reloadData];
                          [weakSelf.tableView stopRefreshAnimation];
                      }];
}

if we drag tableview quickly and the api response fast, then RefreshActionHandler may called multiple times, because tableView have no method/delegate tell us "reloadData" has finished, so stopRefreshAnimation can not be call appropriately!