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

55 lines
1.3 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// MTPageView.h
// MTPage
//
// Created by ko1o on 2019/5/6.
// Copyright © 2019年 ko1o. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "MTPageConfig.h"
NS_ASSUME_NONNULL_BEGIN
@interface MTPageView : UIView
+ (instancetype)pageViewWithItemModels:(NSArray *)itemModels
setupConfig:(void(^)(MTPageConfig *config))setupConfigBlock
itemDidSelect:(void(^)(id itemModel, NSInteger index))itemDidSelectBlock;
@property (nonatomic, strong) UIScrollView *menuContentScrollView;
@property (nonatomic, strong) UIScrollView *pageContentScrollView;
- (MTPageConfig *)pageConfig;
- (void)startLoading;
- (void)endLoadingWithItemModels:(NSArray *)itemModels;
- (BOOL)isLoading;
- (void)viewWillAppear:(BOOL)animated;
/// 所有标签的view controler 的 parent view controller
- (UIViewController *)pageViewController;
- (UIViewController *)currentPageViewController;
/// 选中指定下标是否执行动画根据config的switchAnimated属性
- (void)selectItemAtIndex:(NSInteger)index;
- (void)selectItemAtIndex:(NSInteger)index animated:(BOOL)animated;
/// 对换下标
- (void)exchangeItemAtIndex:(NSInteger)index1 withItemAtIndex:(NSInteger)index2;
/// 移除下标
- (void)removeItemAtIndex:(NSInteger)index;
/// 添加
- (void)addItemWithModel:(id)itemModel;
@end
NS_ASSUME_NONNULL_END