-
Notifications
You must be signed in to change notification settings - Fork 0
/
UIScrollView+Refresh.m
63 lines (40 loc) · 1.22 KB
/
UIScrollView+Refresh.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// NSObject+AFNetworking.h
// Created on 15/7/21.
// Copyright © 2015年 tom. All rights reserved.
//
#import "UIScrollView+Refresh.h"
@implementation UIScrollView (Refresh)
/** 添加头部刷新 */
- (void)addHeaderRefresh:(MJRefreshComponentRefreshingBlock)block{
self.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:block];
}
/** 添加脚部自动刷新 */
- (void)addAutoFooterRefresh:(MJRefreshComponentRefreshingBlock)block{
self.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:block];
}
/** 添加脚步返回刷新 */
- (void)addBackFooterRefresh:(MJRefreshComponentRefreshingBlock)block{
self.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:block];
}
/** 结束头部刷新 */
- (void)endHeaderRefresh{
[self.mj_header endRefreshing];
}
/** 结束脚部刷新 */
- (void)endFooterRefresh{
[self.mj_footer endRefreshing];
}
/** 开始头部刷新 */
- (void)beginHeaderRefresh{
[self.mj_header beginRefreshing];
}
/** 开始脚部刷新 */
-(void)beginFooterRefresh{
[self.mj_footer beginRefreshing];
}
/** 没有更多数据,结束刷新 */
- (void)endRefreshWithNoMoreData{
[self.mj_footer endRefreshingWithNoMoreData];
}
@end