cdts/xdts-ios 3/TreeHole/Code/Utility/MTPage/MTPageConfig.h
2023-07-27 09:20:00 +08:00

84 lines
2.6 KiB
Objective-C

//
// MTPageConfig.h
// MTPage
//
// Created by ko1o on 2019/5/6.
// Copyright © 2019年 ko1o. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, MTPageMenuState) {
MTPageMenuStateNormal,
MTPageMenuStateSelected,
};
/**
创建itemContentView完成后回调
@return 返回自定itemView 会被添加到itemContentView中
*/
typedef UIView *(^MTPageDidSetupMenuItemContentViewBlock)(UIView *menuItemContentView, id itemModel);
/**
创建pageContentView完成后回调
@return 返回viewController的view会被添加到pageContentView中
*/
typedef UIViewController *(^MTPageDidSetupPageContentViewBlock)(UIScrollView *pageContentView, id itemModel);
/// pageView layoutSubview后调用该block
typedef void(^MTPageDidPageViewLayoutSubviewsBlock)(UIView *pageView, UIScrollView *pageContentView, UIScrollView *menuContentView, UIView *slideBarView);
///
typedef void(^MTPageMenuStateChangedBlock)(id itemView, id itemModel, MTPageMenuState state);
@interface MTPageConfig : NSObject
/// default is NO
@property (nonatomic, assign) BOOL showBottomLine;
/// default equal to the width of screen.
@property (nonatomic, assign) CGFloat pageWidth;
/// default equal to the height of screen.
@property (nonatomic, assign) CGFloat pageHeight;
/// default equal to the width of screen.
@property (nonatomic, assign) CGFloat menuContentWidth;
/// default is 50. 固定高度可通过该值设置
@property (nonatomic, assign) CGFloat menuContentHeight;
/// insets of content view, default is (15, 15, 15, 15).
@property (nonatomic, assign) UIEdgeInsets menuContentInset;
/// default is 10.0.
@property (nonatomic, assign) CGFloat menuItemSpacing;
/// defalut is CGSizeZero. 固定itemSize可通过该值设置
@property (nonatomic, assign) CGSize menuItemSize;
/// default is YES. 切换时是否用动画
@property (nonatomic, assign) BOOL switchAnimated;
/// default is 0.25. 动画时长
@property (nonatomic, assign) NSTimeInterval animatedDuration;
/// default is 0.
@property (nonatomic, assign) NSInteger defaultPageIndex;
/// default is YES. 是否可通过pageView左右滑动分页
@property (nonatomic, assign, getter=isPageScrollEnable) BOOL pageScrollEnable;
@property (nonatomic, copy) MTPageDidSetupMenuItemContentViewBlock setupMenuItemContentViewBlock;
@property (nonatomic, copy) MTPageDidSetupPageContentViewBlock setupPageContentViewBlock;
@property (nonatomic, copy) MTPageMenuStateChangedBlock itemStateChangedBlock;
@property (nonatomic, copy) MTPageDidPageViewLayoutSubviewsBlock didLayoutSubviewsBlock;
@end
NS_ASSUME_NONNULL_END