MJRefreshConst.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // 代码地址: https://github.com/CoderMJLee/MJRefresh
  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. #ifdef DEBUG
  7. #define MJRefreshLog(...) NSLog(__VA_ARGS__)
  8. #else
  9. #define MJRefreshLog(...)
  10. #endif
  11. // 过期提醒
  12. #define MJRefreshDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead)
  13. // 运行时objc_MJRefreshMsgSend
  14. #define MJRefreshMsgSend(...) ((void (*)(void *, SEL, UIView *))objc_msgSend)(__VA_ARGS__)
  15. #define MJRefreshMsgTarget(target) (__bridge void *)(target)
  16. // RGB颜色
  17. #define MJRefreshColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
  18. // 文字颜色
  19. #define MJRefreshLabelTextColor MJRefreshColor(90, 90, 90)
  20. // 字体大小
  21. #define MJRefreshLabelFont [UIFont boldSystemFontOfSize:14]
  22. // 图片路径
  23. #define MJRefreshSrcName(file) [@"MJRefresh.bundle" stringByAppendingPathComponent:file]
  24. // 常量
  25. UIKIT_EXTERN const CGFloat MJRefreshHeaderHeight;
  26. UIKIT_EXTERN const CGFloat MJRefreshFooterHeight;
  27. UIKIT_EXTERN const CGFloat MJRefreshFastAnimationDuration;
  28. UIKIT_EXTERN const CGFloat MJRefreshSlowAnimationDuration;
  29. UIKIT_EXTERN NSString *const MJRefreshKeyPathContentOffset;
  30. UIKIT_EXTERN NSString *const MJRefreshKeyPathContentSize;
  31. UIKIT_EXTERN NSString *const MJRefreshKeyPathContentInset;
  32. UIKIT_EXTERN NSString *const MJRefreshKeyPathPanState;
  33. UIKIT_EXTERN NSString *const MJRefreshHeaderLastUpdatedTimeKey;
  34. UIKIT_EXTERN NSString *const MJRefreshHeaderIdleText;
  35. UIKIT_EXTERN NSString *const MJRefreshHeaderPullingText;
  36. UIKIT_EXTERN NSString *const MJRefreshHeaderRefreshingText;
  37. UIKIT_EXTERN NSString *const MJRefreshAutoFooterIdleText;
  38. UIKIT_EXTERN NSString *const MJRefreshAutoFooterRefreshingText;
  39. UIKIT_EXTERN NSString *const MJRefreshAutoFooterNoMoreDataText;
  40. UIKIT_EXTERN NSString *const MJRefreshBackFooterIdleText;
  41. UIKIT_EXTERN NSString *const MJRefreshBackFooterPullingText;
  42. UIKIT_EXTERN NSString *const MJRefreshBackFooterRefreshingText;
  43. UIKIT_EXTERN NSString *const MJRefreshBackFooterNoMoreDataText;
  44. // 状态检查
  45. #define MJRefreshCheckState \
  46. MJRefreshState oldState = self.state; \
  47. if (state == oldState) return; \
  48. [super setState:state];