YHRefreshTableView.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // YHSuperTableView.h
  3. // github: https://github.com/samuelandkevin
  4. //
  5. // Created by samuelandkevin on 16/5/31.
  6. // Copyright © 2016年 HKP. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. //刷新类型
  10. typedef NS_ENUM(int,YHRefreshType){
  11. YHRefreshType_LoadNew = 1, //下拉刷新
  12. YHRefreshType_LoadMore //上拉加载
  13. };
  14. @class YHRefreshTableView;
  15. @protocol YHRefreshTableViewDelegate <NSObject>
  16. - (void)refreshTableViewLoadNew:(YHRefreshTableView*)view;
  17. - (void)refreshTableViewLoadmore:(YHRefreshTableView*)view;
  18. @end
  19. @interface YHRefreshTableView : UITableView
  20. @property (nonatomic,assign ) IBInspectable BOOL enableLoadNew;
  21. @property (nonatomic, assign) IBInspectable BOOL enableLoadMore;
  22. @property (nonatomic, assign) BOOL noData; //无数据
  23. @property (nonatomic, assign) BOOL noMoreData;//上拉加载无更多数据
  24. //开始加载
  25. - (void)loadBegin:(YHRefreshType)type;
  26. //结束加载
  27. - (void)loadFinish:(YHRefreshType)type;
  28. //无数据
  29. - (void)setNoData:(BOOL)noData withText:(NSString *)tips;
  30. - (void)setNoDataInAllSections:(BOOL)showNoDataInAllSections noData:(BOOL)noData withText:(NSString *)tips;
  31. /**
  32. 显示Loading
  33. 与setLoadFailed互斥,不会同时显示
  34. 且当table中有内容时也不显示
  35. */
  36. - (void)showLoadingView:(BOOL)isShow;
  37. /**
  38. 显示加载失败
  39. 与showLoadingView互斥,不会同时显示
  40. */
  41. - (void)setLoadFailed:(BOOL)isFailed;
  42. @end