cdts/xdts-ios 3/TreeHole/Code/Utility/OC_CWCarousel/CWCarousel.h

160 lines
3.5 KiB
C
Raw Permalink Normal View History

2023-07-27 09:20:00 +08:00
//
// CWCarousel.h
// CWCarousel
//
// Created by WangChen on 2018/4/3.
// Copyright © 2018年 ChenWang. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "CWCarouselProtocol.h"
#import "CWFlowLayout.h"
@interface CWCarousel : UIView
#pragma mark - < 相关属性 >
/**
*/
@property (nonatomic, readonly, copy) NSString * _Nullable version;
/**
*/
@property (nonatomic, weak) id <CWCarouselDelegate> _Nullable delegate;
/**
*/
@property (nonatomic, weak) id <CWCarouselDatasource> _Nullable datasource;
/**
layout
*/
@property (nonatomic, strong, readonly) CWFlowLayout * _Nonnull flowLayout;
/**
*/
@property (nonatomic, assign, readonly) CWCarouselStyle style;
/**
style = CWCarouselStyle_H_3时的扩展高度 (1.1.0,使)
*/
@property (nonatomic, assign, readonly) CGFloat addHeight;
/**
(collectionView实现的)
*/
@property (nonatomic, strong, readonly) UICollectionView * _Nonnull carouselView;
/**
, NO
*/
@property (nonatomic, assign) BOOL isAuto;
/**
, 3s
*/
@property (nonatomic, assign) NSTimeInterval autoTimInterval;
/**
pageControl
1.
2. frame自行调整
3. carousel上,addSubview方法添加到其他父视图上
*/
@property (nonatomic, strong) UIPageControl * _Nullable pageControl;
/**
pageControl
*/
@property (nonatomic, strong) UIView<CWCarouselPageControlProtocol> * _Nullable customPageControl;
/**
cell下标
*/
@property (nonatomic, strong) NSIndexPath *currentIndexPath;
- (void)scrollToIndex:(int)index;
/**
YES:
NO:
*/
@property (nonatomic, assign) BOOL endless;
#pragma mark - < 相关方法 >
/**
@param frame
@param delegate
@param datasource
@param flowLayout flowlayout
@return
*/
- (instancetype _Nullable )initWithFrame:(CGRect)frame
delegate:(id<CWCarouselDelegate> _Nullable)delegate
datasource:(id<CWCarouselDatasource> _Nullable)datasource
flowLayout:(nonnull CWFlowLayout *)flowLayout;
/**
@param viewClass
@param identifier
*/
- (void)registerViewClass:(Class _Nullable )viewClass identifier:(NSString *_Nullable)identifier;
/**
@param nibName xib相关文件名
@param identifier
*/
- (void)registerNibView:(NSString *_Nullable)nibName identifier:(NSString *_Nullable)identifier;
/**
*/
- (void)freshCarousel;
/**
,
*/
- (void)resumePlay;
/**
*/
- (void)pause;
/**
,,.
*/
- (void)releaseTimer;
/**
WillAppear方法里调用
*/
- (void)controllerWillAppear;
/**
WillDisAppear方法里调用
*/
- (void)controllerWillDisAppear;
@end