YOUPAIOCBarrageCell.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // YOUPAIOCBarrageCell.h
  3. // TestApp
  4. //
  5. // Created by QMTV on 2017/8/21.
  6. // Copyright © 2017年 LFC. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "CALayer+VQ_OCBarrage.h"
  10. #import "YOUPAIOCBarrageDescriptor.h"
  11. NS_ASSUME_NONNULL_BEGIN
  12. @protocol OCBarrageCellDelegate;
  13. typedef void(^piaoPingBlock)(void);
  14. @interface YOUPAIOCBarrageCell : UIView
  15. @property (nonatomic, assign, getter=isIdle) BOOL idle;//是否是空闲状态
  16. @property (nonatomic, assign) NSTimeInterval idleTime;//开始闲置的时间, 闲置超过5秒的, 自动回收内存
  17. @property (nonatomic, strong, nullable) YOUPAIOCBarrageDescriptor *barrageDescriptor;
  18. @property (nonatomic, strong, readonly, nullable) CAAnimation *barrageAnimation;
  19. @property (nonatomic, assign) int trackIndex;
  20. @property(nonatomic,copy)piaoPingBlock Clickblock;
  21. - (void)youpaifaddBarrageAnimationWithDelegate:(id<CAAnimationDelegate>)animationDelegate;
  22. - (void)prepareForReuse;
  23. - (void)youpaifclearContents;
  24. - (void)youpaifupdateSubviewsData;
  25. - (void)youpaiflayoutContentSubviews;
  26. - (void)youpaifconvertContentToImage;
  27. - (void)sizeToFit;//设置好数据之后调用一下自动计算bounds
  28. - (void)removeSubViewsAndSublayers;//默认删除所有的subview和sublayer; 如果需要选择性的删除可以重写这个方法.
  29. - (void)youpaifaddBorderAttributes;
  30. @end
  31. @protocol OCBarrageCellDelegate <NSObject, CAAnimationDelegate>
  32. @optional
  33. @end
  34. NS_ASSUME_NONNULL_END