美文网首页
刷新控件

刷新控件

作者: 黑夜的眼睛 | 来源:发表于2016-01-21 18:07 被阅读77次

集成刷新控件

#import “MJRefresh.h”

- (void)addHeader

{

__weak typeof(self)weakSelf = self;

//添加下拉刷新头部控件

[table1 addHeaderWithCallback:^{

//进入刷新状态就会回调这个Block

//模拟延迟加载数据,因此2秒后才调用)

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

[weakSelf.table1 reloadData];

//结束刷新

[weakSelf.table1 headerEndRefreshing];

});

}];

//自动刷新(一进入程序就下拉刷新)

[table1 headerBeginRefreshing];

}

相关文章

网友评论

      本文标题:刷新控件

      本文链接:https://www.haomeiwen.com/subject/etwlkttx.html