UIScrollView+NTESPullToRefresh.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // UIScrollView+NTESPullToRefresh.h
  3. //
  4. // Created by chris on 15/2/12.
  5. // Copyright (c) 2015年 Netease. All rights reserved.
  6. //
  7. //
  8. #import <UIKit/UIKit.h>
  9. @class NTESPullToRefreshView;
  10. @interface UIScrollView (NTESPullToRefresh)
  11. typedef NS_ENUM(NSUInteger, NTESPullToRefreshPosition) {
  12. NTESPullToRefreshPositionTop = 0,
  13. NTESPullToRefreshPositionBottom,
  14. };
  15. - (void)addPullToRefreshWithActionHandler:(void (^)(void))actionHandler;
  16. - (void)addPullToRefreshWithActionHandler:(void (^)(void))actionHandler position:(NTESPullToRefreshPosition)position;
  17. - (void)triggerPullToRefresh;
  18. @property (nonatomic, strong, readonly) NTESPullToRefreshView *pullToRefreshView;
  19. @property (nonatomic, assign) BOOL showsPullToRefresh;
  20. @end
  21. typedef NS_ENUM(NSUInteger, NTESPullToRefreshState) {
  22. NTESPullToRefreshStateStopped = 0,
  23. NTESPullToRefreshStateTriggered,
  24. NTESPullToRefreshStateLoading,
  25. NTESPullToRefreshStateAll = 10
  26. };
  27. @interface NTESPullToRefreshView : UIView
  28. @property (nonatomic, strong) UIColor *arrowColor;
  29. @property (nonatomic, strong) UIColor *textColor;
  30. @property (nonatomic, strong, readonly) UILabel *titleLabel;
  31. @property (nonatomic, strong, readonly) UILabel *subtitleLabel;
  32. @property (nonatomic, strong, readwrite) UIColor *activityIndicatorViewColor;
  33. @property (nonatomic, readwrite) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
  34. @property (nonatomic, readonly) NTESPullToRefreshState state;
  35. @property (nonatomic, readonly) NTESPullToRefreshPosition position;
  36. - (void)setTitle:(NSString *)title forState:(NTESPullToRefreshState)state;
  37. - (void)setSubtitle:(NSString *)subtitle forState:(NTESPullToRefreshState)state;
  38. - (void)setCustomView:(UIView *)view forState:(NTESPullToRefreshState)state;
  39. - (void)startAnimating;
  40. - (void)stopAnimating;
  41. @end