commit | author | age
|
892936
|
1 |
// 代码地址: https://github.com/CoderMJLee/MJRefresh |
H |
2 |
// 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 |
|
3 |
#import <UIKit/UIKit.h> |
|
4 |
#import <objc/message.h> |
|
5 |
|
|
6 |
// 日志输出 |
|
7 |
#ifdef DEBUG |
|
8 |
#define MJRefreshLog(...) NSLog(__VA_ARGS__) |
|
9 |
#else |
|
10 |
#define MJRefreshLog(...) |
|
11 |
#endif |
|
12 |
|
|
13 |
// 过期提醒 |
|
14 |
#define MJRefreshDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead) |
|
15 |
|
|
16 |
// 运行时objc_msgSend |
|
17 |
#define MJRefreshMsgSend(...) ((void (*)(void *, SEL, UIView *))objc_msgSend)(__VA_ARGS__) |
|
18 |
#define MJRefreshMsgTarget(target) (__bridge void *)(target) |
|
19 |
|
|
20 |
// RGB颜色 |
|
21 |
#define MJRefreshColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0] |
|
22 |
|
|
23 |
// 文字颜色 |
|
24 |
#define MJRefreshLabelTextColor MJRefreshColor(90, 90, 90) |
|
25 |
|
|
26 |
// 字体大小 |
|
27 |
#define MJRefreshLabelFont [UIFont boldSystemFontOfSize:14] |
|
28 |
|
|
29 |
// 图片路径 |
|
30 |
#define MJRefreshSrcName(file) [@"WASDK-Resource.bundle" stringByAppendingPathComponent:file] |
|
31 |
#define MJRefreshFrameworkSrcName(file) [@"Frameworks/MJRefresh.framework/MJRefresh.bundl" stringByAppendingPathComponent:file] |
|
32 |
|
|
33 |
// 常量 |
|
34 |
UIKIT_EXTERN const CGFloat MJRefreshHeaderHeight; |
|
35 |
UIKIT_EXTERN const CGFloat MJRefreshFooterHeight; |
|
36 |
UIKIT_EXTERN const CGFloat MJRefreshFastAnimationDuration; |
|
37 |
UIKIT_EXTERN const CGFloat MJRefreshSlowAnimationDuration; |
|
38 |
|
|
39 |
UIKIT_EXTERN NSString *const MJRefreshKeyPathContentOffset; |
|
40 |
UIKIT_EXTERN NSString *const MJRefreshKeyPathContentSize; |
|
41 |
UIKIT_EXTERN NSString *const MJRefreshKeyPathContentInset; |
|
42 |
UIKIT_EXTERN NSString *const MJRefreshKeyPathPanState; |
|
43 |
|
|
44 |
UIKIT_EXTERN NSString *const MJRefreshHeaderLastUpdatedTimeKey; |
|
45 |
|
|
46 |
UIKIT_EXTERN NSString *const MJRefreshHeaderIdleText; |
|
47 |
UIKIT_EXTERN NSString *const MJRefreshHeaderPullingText; |
|
48 |
UIKIT_EXTERN NSString *const MJRefreshHeaderRefreshingText; |
|
49 |
|
|
50 |
UIKIT_EXTERN NSString *const MJRefreshAutoFooterIdleText; |
|
51 |
UIKIT_EXTERN NSString *const MJRefreshAutoFooterRefreshingText; |
|
52 |
UIKIT_EXTERN NSString *const MJRefreshAutoFooterNoMoreDataText; |
|
53 |
|
|
54 |
UIKIT_EXTERN NSString *const MJRefreshBackFooterIdleText; |
|
55 |
UIKIT_EXTERN NSString *const MJRefreshBackFooterPullingText; |
|
56 |
UIKIT_EXTERN NSString *const MJRefreshBackFooterRefreshingText; |
|
57 |
UIKIT_EXTERN NSString *const MJRefreshBackFooterNoMoreDataText; |
|
58 |
|
|
59 |
// 状态检查 |
|
60 |
#define MJRefreshCheckState \ |
|
61 |
MJRefreshState oldState = self.state; \ |
|
62 |
if (state == oldState) return; \ |
|
63 |
[super setState:state]; |