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
52
53
54
55
56
57
//
// KWMCollectionRefreshUtil.h
// iCemarose
//
// Created by HouWeiBin on 2017/6/16.
// Copyright © 2017年 kollway. All rights reserved.
//
// 这个工具类只支持简单的collection样式,如果有更复杂的需要,后面会进行调整。
#import <Foundation/Foundation.h>
@class KWMCollectionRefreshUtil;
@protocol KWMCollectionRefreshDelegate
- (void)refreshUtil:(KWMCollectionRefreshUtil *)util onLoad:(NSInteger)page;
@end
@interface KWMCollectionRefreshUtil : NSObject
@property (nonatomic, weak) id<KWMCollectionRefreshDelegate> delegate;
@property (nonatomic, weak) UICollectionView *collectionView;
@property (nonatomic, weak) UIView *emptyView;
@property (nonatomic) NSString *emptyMsg;
@property (nonatomic) NSString *imageName;
@property (nonatomic) BOOL isShowEmptyImage;
@property (nonatomic) NSMutableArray *lastResult;
@property (nonatomic) NSMutableArray *dataList;
@property (nonatomic) BOOL hasNextPage;
@property (nonatomic) NSInteger page;
@property (nonatomic, copy) BOOL (^dataFilter)(id data);
@property (nonatomic) BOOL hideHeader;
-(void)setRefreshNull;
- (void)reLoadData;
- (void)clearData;
- (BOOL)isLoading;
- (void)hideLoading;
- (void)appendDataList:(NSArray *)result;
- (BOOL)isReload;
@end