// // FKRefreshControl.h // FirstLink // // Created by jack on 15/12/1. // Copyright © 2015年 FirstLink. All rights reserved. // #import ///** // * 当前refreshing状态 // */ //typedef enum { // FKRefreshingDirectionNone = 0, // FKRefreshingDirectionTop = 1 << 0, // FKRefreshingDirectionBottom = 1 << 1 //} FKRefreshingDirections; // ///** // * 指定回调方向 // */ //typedef enum { // FKRefreshDirectionTop = 0, // FKRefreshDirectionBottom //} FKRefreshDirection; @protocol FKRefreshControlDelegate; @interface FKRefreshControl : NSObject ///当前的状态 @property (nonatomic,assign,readonly)RefreshingDirections refreshingDirection; @property (nonatomic,readonly)UIScrollView * scrollView; - (instancetype)initWithScrollView:(UIScrollView *)scrollView delegate:(id)delegate; ///是否开启下拉刷新,YES-开启 NO-不开启 默认是NO @property (nonatomic,assign)BOOL topEnabled; ///是否开启上拉加载更多,YES-开启 NO-不开启 默认是NO @property (nonatomic,assign)BOOL bottomEnabled; ///下拉刷新 状态改变的距离 默认65.0 @property (nonatomic,assign)float enableInsetTop; ///上拉 状态改变的距离 默认65.0 @property (nonatomic,assign)float enableInsetBottom; /* *是否开启自动刷新,下拉到enableInsetTop位置自动刷新 YES-开启,NO-不开启,默认是NO */ @property (nonatomic,assign)BOOL autoRefreshTop; /* * 是否开启自动加载更多,上拉到enableInsetBottom位置自动加载跟多 YES-开启,NO-不开启,默认是NO */ @property (nonatomic,assign)BOOL autoRefreshBottom; /** * 注册Top加载的view,view必须接受RefreshViewDelegate协议,默认是RefreshTopView * @param topClass 类类型 */ - (void)registerClassForTopView:(Class)topClass; /** * 注册Bottom加载的view,view必须接受RefreshViewDelegate协议,默认是RefreshBottomView * @param bottomClass 类类型 */ - (void)registerClassForBottomView:(Class)bottomClass; ///开始 - (void)startRefreshingDirection:(RefreshDirection)direction; ///完成 - (void)finishRefreshingDirection:(RefreshDirection)direction; @end /** * 代理方法 */ @protocol FKRefreshControlDelegate @optional - (void)refreshControl:(FKRefreshControl *)refreshControl didEngageRefreshDirection:(RefreshDirection) direction; @end