第三方 ”MJ“ 上拉下拉刷新

arr = [NSMutableArray arrayWithObjects:@"刷新功能",@"功能",@"添加",@"上拉加载更多",@"加载更多",@"有道", nil];




-(void)refreshViewBeginRefreshing:(MJRefreshBaseView *)refreshView{

if ([refreshView isKindOfClass:[MJRefreshHeaderView class]]) {

//2秒以后调用

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{

// 10    1

[arr addObject:@"iOS新加"];

[mainTableView reloadData];

[_header endRefreshing];

});

}else{

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{

[arr removeObjectAtIndex:0];

[mainTableView reloadData];

[_footer endRefreshing];

});

}

}

你可能感兴趣的:(第三方 ”MJ“ 上拉下拉刷新)