EaseRefreshTableViewController.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 系统消息技淘智推 */
  21. @property (strong, nonatomic) NSMutableArray *systemArray;
  22. /** @brief 导航栏右侧BarItem */
  23. @property (strong, nonatomic) NSArray *rightItems;
  24. /** @brief 默认的tableFooterView */
  25. @property (strong, nonatomic) UIView *defaultFooterView;
  26. @property (strong, nonatomic) UITableView *tableView;
  27. /** @brief tableView的数据源,用户UI显示 */
  28. @property (strong, nonatomic) NSMutableArray *dataArray;
  29. @property (strong, nonatomic) NSMutableDictionary *dataDictionary;
  30. /** @brief 当前加载的页数 */
  31. @property (nonatomic) int page;
  32. /** @brief 是否启用下拉加载更多,默认为NO */
  33. @property (nonatomic) BOOL showRefreshHeader;
  34. /** @brief 是否启用上拉加载更多,默认为NO */
  35. @property (nonatomic) BOOL showRefreshFooter;
  36. /** @brief 是否显示无数据时的空白提示,默认为NO(未实现提示页面) */
  37. @property (nonatomic) BOOL showTableBlankView;
  38. /*!
  39. @method
  40. @brief 初始化ViewController
  41. @discussion
  42. @param style tableView样式
  43. @return
  44. */
  45. - (instancetype)initWithStyle:(UITableViewStyle)style;
  46. /*!
  47. @method
  48. @brief 下拉加载更多(下拉刷新)
  49. @discussion
  50. @return
  51. */
  52. - (void)tableViewDidTriggerHeaderRefresh;
  53. /*!
  54. @method
  55. @brief 上拉加载更多
  56. @discussion
  57. @return
  58. */
  59. - (void)tableViewDidTriggerFooterRefresh;
  60. /*!
  61. @method
  62. @brief 加载结束
  63. @discussion 加载结束后,通过参数reload来判断是否需要调用tableView的reloadData,判断isHeader来停止加载
  64. @param isHeader 是否结束下拉加载(或者上拉加载)
  65. @param reload 是否需要重载TabeleView
  66. @return
  67. */
  68. - (void)tableViewDidFinishTriggerHeader:(BOOL)isHeader reload:(BOOL)reload;
  69. @end