XYRotaryTableView.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // XYRotaryTableView.h
  3. // Timi
  4. //
  5. // Created by 翟玉磊 on 2021/4/14.
  6. //
  7. #import "BaseView.h"
  8. NS_ASSUME_NONNULL_BEGIN
  9. typedef enum : NSUInteger {
  10. XYRotaryTableStateNormal = 0, // 默认状态
  11. XYRotaryTableStateReady, // 准备旋转状态
  12. XYRotaryTableStateRotating, // 旋转中
  13. XYRotaryTableStateFinish, // 旋转结束(已出奖)
  14. } XYRotaryTableState;
  15. @class XYRotaryTableView;
  16. @protocol XYRotaryTableViewDelegate <NSObject>
  17. /// 点击抽奖
  18. - (void)turntableLotteryWithRotaryTable:(XYRotaryTableView *)rotaryTable;
  19. /// 转盘开始旋转回调
  20. - (void)didBeginRotatingWithRotaryTable:(XYRotaryTableView *)rotaryTable;
  21. /// 转盘结束旋转回调
  22. - (void)didEndRotatingWithRotaryTable:(XYRotaryTableView *)rotaryTable;
  23. @end
  24. @interface XYRotaryTableView : BaseView
  25. @property (nonatomic, weak) id<XYRotaryTableViewDelegate>delegate;
  26. @property (nonatomic, assign) XYRotaryTableState state;
  27. /// 转盘背景
  28. @property (nonatomic, strong) UIImage *backgroundImage;
  29. /// 转盘指针
  30. @property (nonatomic, strong) UIImage *pointerImage;
  31. /// 是否启用目前只有主持人有权限 默认是启用YES
  32. @property (nonatomic, assign) BOOL enabled;
  33. /// 动画时间 默认3秒
  34. @property (nonatomic, assign) NSInteger animationDuration;
  35. /// 设置转盘奖项
  36. - (void)setupRotaryTableItems:(NSArray *)array;
  37. /// 设置转盘结果 (类目索引)
  38. - (void)setupRotaryTableResult:(NSInteger)index;
  39. /// 设置隐藏时间倒计时
  40. - (void)setupHideTime:(NSInteger)time;
  41. - (void)clear;
  42. @end
  43. NS_ASSUME_NONNULL_END