123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- //
- // XYRotaryTableView.h
- // Timi
- //
- // Created by 翟玉磊 on 2021/4/14.
- //
- #import "BaseView.h"
- NS_ASSUME_NONNULL_BEGIN
- typedef enum : NSUInteger {
- XYRotaryTableStateNormal = 0, // 默认状态
- XYRotaryTableStateReady, // 准备旋转状态
- XYRotaryTableStateRotating, // 旋转中
- XYRotaryTableStateFinish, // 旋转结束(已出奖)
- } XYRotaryTableState;
- @class XYRotaryTableView;
- @protocol XYRotaryTableViewDelegate <NSObject>
- /// 点击抽奖
- - (void)turntableLotteryWithRotaryTable:(XYRotaryTableView *)rotaryTable;
- /// 转盘开始旋转回调
- - (void)didBeginRotatingWithRotaryTable:(XYRotaryTableView *)rotaryTable;
- /// 转盘结束旋转回调
- - (void)didEndRotatingWithRotaryTable:(XYRotaryTableView *)rotaryTable;
- @end
- @interface XYRotaryTableView : BaseView
- @property (nonatomic, weak) id<XYRotaryTableViewDelegate>delegate;
- @property (nonatomic, assign) XYRotaryTableState state;
- /// 转盘背景
- @property (nonatomic, strong) UIImage *backgroundImage;
- /// 转盘指针
- @property (nonatomic, strong) UIImage *pointerImage;
- /// 是否启用目前只有主持人有权限 默认是启用YES
- @property (nonatomic, assign) BOOL enabled;
- /// 动画时间 默认3秒
- @property (nonatomic, assign) NSInteger animationDuration;
- /// 设置转盘奖项
- - (void)setupRotaryTableItems:(NSArray *)array;
- /// 设置转盘结果 (类目索引)
- - (void)setupRotaryTableResult:(NSInteger)index;
- /// 设置隐藏时间倒计时
- - (void)setupHideTime:(NSInteger)time;
- - (void)clear;
- @end
- NS_ASSUME_NONNULL_END
|