12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- //
- // GHRefreshTableView.h
- // GameHelper
- //
- // Created by 青秀斌 on 16/12/29.
- // Copyright © 2016年 kylincc. All rights reserved.
- //
- #import <UIKit/UIKit.h>
- #import "CarRefreshHeadView.h"
- #import "GHRefreshHeader.h"
- @protocol GHRefreshTableViewDelegate;
- NS_ASSUME_NONNULL_BEGIN
- @interface GHRefreshTableView : UITableView
- @property (weak, nonatomic) IBOutlet id<GHRefreshTableViewDelegate> refreshDelegate;
- @property (strong, nonatomic, readonly) NSMutableArray *dataArray;
- @property (assign, nonatomic, readonly) NSUInteger pageIndex;
- @property (assign, nonatomic) NSUInteger pageSize;
- @property (nonatomic, copy) void (^reloadView)(NSArray *list); //自定义加载数据方法
- @property (assign, nonatomic) BOOL allowShowMore; //是否显示加载更多(默认显示)
- @property (assign, nonatomic) BOOL allowShowBlank; //是否显示占位图(默认显示)
- @property (assign, nonatomic) BOOL allowShowNoNetworkBlank; //是否显示无网占位图(默认显示)
- @property (assign, nonatomic) BOOL allowCarRefreshAnimation; //允许车辆刷新动画
- @property (assign, nonatomic) BOOL allowExternalControlShowBlank; //是否由外部设置showBlankView控制占位图(默认NO)
- @property (assign, nonatomic) BOOL allowShowBlankWithHeaderTableView; //是否将内容提示加载在HeaderTableView上(默认NO)
- @property (assign, nonatomic) BOOL allowShowBlankWithHeaderTableViewByNotDeveloped; //是否将内容提示加载在HeaderTableView上,表示“敬请期待”(默认NO)
- @property (assign, nonatomic) CarRefreshBackgroundType carRefreshBackgroundType;
- @property (nullable, strong, nonatomic) NSString *blankImage;
- @property (nullable, strong, nonatomic) NSString *blankTitle;
- @property (nullable, strong, nonatomic) NSString *blankMessage;
- @property (assign, nonatomic) CGFloat offsetY;
- @property (assign, nonatomic) BOOL isLoad;
- @property (nullable, nonatomic, strong) GHRefreshHeader *refreshHeaderView;
- // 移除“没有数据”文字+图片
- -(void)removeBlackView;
- // 重新设置BlankView的位置
- -(void)showBlankView_offsetY:(CGFloat)offsetY;
- // 移除 头view
- -(void)removeHeaderView;
- // 重新刷新数据+下拉动画
- - (void)refreshData;
- // 重新刷新数据 不+下拉动画
- - (void)refreshDataNoAnimation;
- // 添加“没有数据”文字+图片
- - (void)showBlankView:(NSString *)blankImg blankTitle:(NSString *)blankTitle;
- //针对学习模块 - 删除所有数据之后再进行刷新
- - (void)removeAllDataToReload;
- @end
- @protocol GHRefreshTableViewDelegate <NSObject>
- @required
- /**
- 上拉加载和下拉刷新回调事件
-
- @param tableView 当前TableView
- @param pageIndex 加载页号(为0是即为下拉刷新)
- @param success 成功回调(传入当前页数据,页面将自动刷新)
- @param failure 失败回调(传入失败信息,页面将自动提示)
- */
- - (void)tableView:(GHRefreshTableView *)tableView
- pageIndex:(NSUInteger)pageIndex
- offset:(NSInteger)offset
- pageSize:(NSUInteger)pageSize
- success:(void (^)(NSArray * _Nullable list, BOOL hasNext))success
- failure:(void (^)(NSError *error))failure;
- @end
- NS_ASSUME_NONNULL_END
|