TCBGMCutView.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //
  2. // TCBGMCutView.h
  3. // TXXiaoShiPinDemo
  4. //
  5. // Created by linkzhzhu on 2017/12/14.
  6. // Copyright © 2017年 tencent. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "VideoRangeConst.h"
  10. #import "RangeContent.h"
  11. #import <UIKit/UIGestureRecognizerSubclass.h>
  12. #import <objc/runtime.h>
  13. @interface TCBGMCutViewConfig : NSObject
  14. @property (nonatomic, assign) CGRect frame;
  15. @property (nonatomic) NSInteger pinWidth;
  16. @property (nonatomic) NSInteger thumbHeight;
  17. @property (nonatomic) NSInteger borderHeight;
  18. @property (nonatomic) UIImage* leftPinImage;
  19. @property (nonatomic) UIImage* centerPinImage;
  20. @property (nonatomic) UIImage* rightPigImage;
  21. @property (nonatomic) UIImage* leftCorverImage;
  22. @property (nonatomic) UIImage* rightCoverImage;
  23. @end
  24. @protocol BGMCutDelegate;
  25. @interface TCBGMCutView : UIView
  26. @property (nonatomic, weak) id<BGMCutDelegate> delegate;
  27. @property (nonatomic) CGFloat leftPinCenterX; //左拉条位置
  28. @property (nonatomic) CGFloat rightPinCenterX; //右拉条位置
  29. @property (nonatomic) UIImageView *leftPin; //左拉条
  30. @property (nonatomic) UIImageView *rightPin; //右拉条
  31. @property (nonatomic) UIView *topBorder; //上边
  32. @property (nonatomic) UIView *bottomBorder; //下边
  33. @property (nonatomic) UIImageView *leftCover; //左拉覆盖
  34. @property (nonatomic) UIImageView *rightCover; //右拉覆盖
  35. @property (nonatomic, copy) NSArray<UIImageView *> *imageViewList;
  36. @property (nonatomic, copy) NSArray *imageList; //显示图列表
  37. @property (nonatomic, readonly) CGFloat pinWidth; //拉条大小
  38. @property (nonatomic, readonly) CGFloat imageWidth;
  39. @property (nonatomic, readonly) CGFloat imageListWidth;
  40. @property (nonatomic, readonly) CGFloat leftScale; //左拉条的位置比例
  41. @property (nonatomic, readonly) CGFloat rightScale; //右拉条的位置比例
  42. - (instancetype)initWithImageList:(NSArray *)images;
  43. - (instancetype)initWithImageList:(NSArray *)images config:(TCBGMCutViewConfig*)config;
  44. -(void) resetCutView;
  45. @end
  46. @protocol BGMCutDelegate <NSObject>
  47. @optional
  48. - (void)onRangeLeftChangeBegin:(id)sender;
  49. - (void)onRangeLeftChanged:(id)sender percent:(CGFloat)percent;
  50. - (void)onRangeLeftChangeEnded:(id)sender percent:(CGFloat)percent;
  51. - (void)onRangeRightChangeBegin:(id)sender;
  52. - (void)onRangeRightChanged:(id)sender;
  53. - (void)onRangeRightChangeEnded:(id)sender;
  54. - (void)onRangeLeftAndRightChanged:(id)sender;
  55. @end
  56. @interface TCPanGestureRecognizer : UIPanGestureRecognizer
  57. -(instancetype)initWithTarget:(id)target action:(SEL)action inview:(UIView*)view;
  58. @property CGPoint beginPoint;
  59. @property UIView* inView;
  60. @end