EaseRefreshTableViewController.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /************************************************************
  2. * * Hyphenate CONFIDENTIAL
  3. * __________________
  4. * Copyright (C) 2016 Hyphenate Inc. All rights reserved.
  5. *
  6. * NOTICE: All information contained herein is, and remains
  7. * the property of Hyphenate Inc.
  8. * Dissemination of this information or reproduction of this material
  9. * is strictly forbidden unless prior written permission is obtained
  10. * from Hyphenate Inc.
  11. */
  12. #import <UIKit/UIKit.h>
  13. /** @brief tabeleView的cell高度 */
  14. #define KCELLDEFAULTHEIGHT 50
  15. /** @brief 带加载、刷新的Controller(包含UITableView) */
  16. @interface EaseRefreshTableViewController : UIViewController<UITableViewDataSource, UITableViewDelegate>
  17. {
  18. NSArray *_rightItems;
  19. }
  20. /** @brief 导航栏右侧BarItem */
  21. @property (strong, nonatomic) NSArray *rightItems;
  22. /** @brief 默认的tableFooterView */
  23. @property (strong, nonatomic) UIView *defaultFooterView;
  24. @property (strong, nonatomic) UITableView *tableView;
  25. /** @brief tableView的数据源,用户UI显示 */
  26. @property (strong, nonatomic) NSMutableArray *dataArray;
  27. @property (strong, nonatomic) NSMutableDictionary *dataDictionary;
  28. /** @brief 当前加载的页数 */
  29. @property (nonatomic) int page;
  30. /** @brief 是否启用下拉加载更多,默认为NO */
  31. @property (nonatomic) BOOL showRefreshHeader;
  32. /** @brief 是否启用上拉加载更多,默认为NO */
  33. @property (nonatomic) BOOL showRefreshFooter;
  34. /** @brief 是否显示无数据时的空白提示,默认为NO(未实现提示页面) */
  35. @property (nonatomic) BOOL showTableBlankView;
  36. /*!
  37. @method
  38. @brief 初始化ViewController
  39. @discussion
  40. @param style tableView样式
  41. @return
  42. */
  43. - (instancetype)initWithStyle:(UITableViewStyle)style;
  44. /*!
  45. @method
  46. @brief 下拉加载更多(下拉刷新)
  47. @discussion
  48. @return
  49. */
  50. - (void)tableViewDidTriggerHeaderRefresh;
  51. /*!
  52. @method
  53. @brief 上拉加载更多
  54. @discussion
  55. @return
  56. */
  57. - (void)tableViewDidTriggerFooterRefresh;
  58. /*!
  59. @method
  60. @brief 加载结束
  61. @discussion 加载结束后,通过参数reload来判断是否需要调用tableView的reloadData,判断isHeader来停止加载
  62. @param isHeader 是否结束下拉加载(或者上拉加载)
  63. @param reload 是否需要重载TabeleView
  64. @return
  65. */
  66. - (void)tableViewDidFinishTriggerHeader:(BOOL)isHeader reload:(BOOL)reload;
  67. @end