Files
keyboard/Pods/JXPagingView/Sources/JXPagerView/JXPagerListContainerView.h

129 lines
6.0 KiB
C
Raw Normal View History

2025-11-06 19:19:12 +08:00
//
// JXCategoryListScrollView.h
// JXCategoryView
//
// Created by jiaxin on 2018/9/12.
// Copyright © 2018年 jiaxin. All rights reserved.
//
#import <UIKit/UIKit.h>
@class JXPagerListContainerView;
@class JXPagerListContainerScrollView;
@protocol JXPagerViewListViewDelegate <NSObject>
/**
listViewvc包裹的就是vc.viewview包裹的view自己
@return UIView
*/
- (UIView *)listView;
/**
listView内部持有的UIScrollView或UITableView或UICollectionView
mainTableView已经显示了headerlistView的contentOffset需要重置时访listView内的scrollView
@return listView内部持有的UIScrollView或UITableView或UICollectionView
*/
- (UIScrollView *)listScrollView;
/**
listView内部持有的UIScrollView或UITableView或UICollectionView的代理方法`scrollViewDidScroll`callback
@param callback `scrollViewDidScroll`callback
*/
- (void)listViewDidScrollCallback:(void (^)(UIScrollView *scrollView))callback;
@optional
- (void)listScrollViewWillResetContentOffset;
- (void)listWillAppear;
- (void)listDidAppear;
- (void)listWillDisappear;
- (void)listDidDisappear;
@end
/**
- ScrollView: UIScrollView
- CollectionView: 使UICollectionViewcell上cell重用机制的问题使使CollectionView的时候使
*/
typedef NS_ENUM(NSUInteger, JXPagerListContainerType) {
JXPagerListContainerType_ScrollView,
JXPagerListContainerType_CollectionView,
};
@protocol JXPagerListContainerViewDelegate <NSObject>
/**
list的数量
@param listContainerView
@return list的数量
*/
- (NSInteger)numberOfListsInlistContainerView:(JXPagerListContainerView *)listContainerView;
/**
index返回一个对应列表实例`JXPagerViewListViewDelegate`
UIView封装的UIView遵从`JXPagerViewListViewDelegate`UIView即可
UIViewController封装的UIViewController遵从`JXPagerViewListViewDelegate`UIViewController即可
@param listContainerView
@param index
@return JXPagerViewListViewDelegate协议的list实例
*/
- (id<JXPagerViewListViewDelegate>)listContainerView:(JXPagerListContainerView *)listContainerView initListForIndex:(NSInteger)index;
@optional
/**
UIScrollView或UICollectionView的Class
UIScrollView内部逻辑FDFullscreenPopGesture
@param listContainerView JXPagerListContainerView
@return UIScrollView实例
*/
- (Class)scrollViewClassInlistContainerView:(JXPagerListContainerView *)listContainerView;
/**
index的列表
*/
- (BOOL)listContainerView:(JXPagerListContainerView *)listContainerView canInitListAtIndex:(NSInteger)index;
- (void)listContainerViewDidScroll:(UIScrollView *)scrollView;
- (void)listContainerViewWillBeginDragging:(JXPagerListContainerView *)listContainerView;
- (void)listContainerViewWDidEndScroll:(JXPagerListContainerView *)listContainerView;
- (void)listContainerView:(JXPagerListContainerView *)listContainerView listDidAppearAtIndex:(NSInteger)index;
@end
@interface JXPagerListContainerView : UIView
@property (nonatomic, assign, readonly) JXPagerListContainerType containerType;
@property (nonatomic, strong, readonly) UIScrollView *scrollView;
@property (nonatomic, strong, readonly) NSDictionary <NSNumber *, id<JXPagerViewListViewDelegate>> *validListDict; //已经加载过的列表字典。key是indexvalue是对应的列表
@property (nonatomic, strong) UIColor *listCellBackgroundColor; //默认:[UIColor whiteColor]
/**
0.010~101
*/
@property (nonatomic, assign) CGFloat initListPercent;
///当使用Category嵌套Paging的时候需要设置为YES默认为NO
@property (nonatomic, assign, getter=isCategoryNestPagingEnabled) BOOL categoryNestPagingEnabled;
@property (nonatomic, assign, readonly) NSInteger currentIndex;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;
- (instancetype)initWithType:(JXPagerListContainerType)type delegate:(id<JXPagerListContainerViewDelegate>)delegate NS_DESIGNATED_INITIALIZER;
@end
@interface JXPagerListContainerView (ListContainer)
- (void)setDefaultSelectedIndex:(NSInteger)index;
- (UIScrollView *)contentScrollView;
- (void)reloadData;
- (void)scrollingFromLeftIndex:(NSInteger)leftIndex toRightIndex:(NSInteger)rightIndex ratio:(CGFloat)ratio selectedIndex:(NSInteger)selectedIndex;
- (void)didClickSelectedItemAtIndex:(NSInteger)index;
@end