FWScrollViewWrapper

@interface FWScrollViewWrapper : FWViewWrapper

Undocumented

  • Undocumented

    Declaration

    Objective-C

    FWWrapperCompatible, fw)

FWUIKit

  • 判断当前scrollView内容是否足够滚动

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL canScroll;
  • 判断当前的scrollView内容是否足够水平滚动

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL canScrollHorizontal;
  • 判断当前的scrollView内容是否足够纵向滚动

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL canScrollVertical;
  • 当前scrollView滚动到指定边

    Declaration

    Objective-C

    - (void)scrollToEdge:(UIRectEdge)edge animated:(BOOL)animated;
  • 是否已滚动到指定边

    Declaration

    Objective-C

    - (BOOL)isScrollToEdge:(UIRectEdge)edge;
  • 获取当前的scrollView滚动到指定边时的contentOffset(包含contentInset)

    Declaration

    Objective-C

    - (CGPoint)contentOffsetOfEdge:(UIRectEdge)edge;
  • 总页数,自动识别翻页方向

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSInteger totalPage;
  • 当前页数,不支持动画,自动识别翻页方向

    Declaration

    Objective-C

    @property (nonatomic) NSInteger currentPage;
  • 设置当前页数,支持动画,自动识别翻页方向

    Declaration

    Objective-C

    - (void)setCurrentPage:(NSInteger)page animated:(BOOL)animated;
  • 是否是最后一页,自动识别翻页方向

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isLastPage;

FWDrawerView

FWEmptyPlugin

FWScrollOverlayView

  • 滚动视图自定义浮层,用于显示空界面等,兼容UITableView|UICollectionView

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIView *_Nonnull overlayView;
  • 是否显示自定义浮层

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL hasOverlayView;
  • 显示自定义浮层,自动添加到滚动视图顶部、表格视图底部

    Declaration

    Objective-C

    - (void)showOverlayView;
  • 显示自定义浮层,执行渐变动画,自动添加到滚动视图顶部、表格视图底部

    Declaration

    Objective-C

    - (void)showOverlayViewAnimated:(BOOL)animated;
  • 隐藏自定义浮层,自动从滚动视图移除

    Declaration

    Objective-C

    - (void)hideOverlayView;

FWRefreshPlugin

  • 自定义刷新插件,未设置时自动从插件池加载

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) id<FWRefreshPlugin> refreshPlugin;

Refreshing

  • 是否正在刷新中

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isRefreshing;
  • 是否显示刷新组件

    Declaration

    Objective-C

    @property (nonatomic) BOOL showRefreshing;
  • 配置下拉刷新句柄

    Declaration

    Objective-C

    - (void)setRefreshingBlock:(nonnull void (^)(void))block;
  • 配置下拉刷新事件

    Declaration

    Objective-C

    - (void)setRefreshingTarget:(nonnull id)target action:(nonnull SEL)action;
  • 开始下拉刷新

    Declaration

    Objective-C

    - (void)beginRefreshing;
  • 结束下拉刷新

    Declaration

    Objective-C

    - (void)endRefreshing;

Loading

  • 是否正在追加中

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isLoading;
  • 是否显示追加组件

    Declaration

    Objective-C

    @property (nonatomic) BOOL showLoading;
  • 配置上拉追加句柄

    Declaration

    Objective-C

    - (void)setLoadingBlock:(nonnull void (^)(void))block;
  • 配置上拉追加事件

    Declaration

    Objective-C

    - (void)setLoadingTarget:(nonnull id)target action:(nonnull SEL)action;
  • 开始上拉追加

    Declaration

    Objective-C

    - (void)beginLoading;
  • 结束上拉追加

    Declaration

    Objective-C

    - (void)endLoading;

FWPullRefresh

FWInfiniteScroll

Content

  • 内容视图,子视图需添加到本视图,布局约束完整时可自动滚动

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIView *_Nonnull contentView;

Frame

  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic) CGFloat contentWidth
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic) CGFloat contentHeight
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic) CGFloat contentOffsetX
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic) CGFloat contentOffsetY

Scroll

  • UIScrollView真正的inset,iOS11+使用adjustedContentInset,iOS11以下使用contentInset

    Declaration

    Objective-C

    @property (nonatomic, readonly) UIEdgeInsets contentInset;
  • 当前滚动方向,如果多个方向滚动,取绝对值较大的一方,失败返回0

    Declaration

    Objective-C

    @property (nonatomic, readonly) UISwipeGestureRecognizerDirection scrollDirection;
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGFloat scrollPercent
  • Undocumented

    Declaration

    Objective-C

    - (CGFloat)scrollPercentOfDirection:(UISwipeGestureRecognizerDirection)direction;

Content

Keyboard

  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic) BOOL keyboardDismissOnDrag

Gesture

  • Undocumented

    Declaration

    Objective-C

    @property (nullable, nonatomic, copy) BOOL (^shouldBegin
  • Undocumented

    Declaration

    Objective-C

    @property (nullable, nonatomic, copy) BOOL (^shouldRecognizeSimultaneously
  • Undocumented

    Declaration

    Objective-C

    @property (nullable, nonatomic, copy) BOOL (^shouldRequireFailure
  • Undocumented

    Declaration

    Objective-C

    @property (nullable, nonatomic, copy) BOOL (^shouldBeRequiredToFail

Hover

  • 设置自动布局视图悬停到指定父视图固定位置,在scrollViewDidScroll:中调用即可

    Declaration

    Objective-C

    - (CGFloat)hoverView:(nonnull UIView *)view
           fromSuperview:(nonnull UIView *)fromSuperview
             toSuperview:(nonnull UIView *)toSuperview
              toPosition:(CGFloat)toPosition;

    Parameters

    view

    需要悬停的视图,须占满fromSuperview

    fromSuperview

    起始的父视图,须是scrollView的子视图

    toSuperview

    悬停的目标视图,须是scrollView的父级视图,一般控制器self.view

    toPosition

    需要悬停的目标位置,相对于toSuperview的originY位置

    Return Value

    相对于悬浮位置的距离,可用来设置导航栏透明度等