OCBarrageCell.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // OCBarrageCell.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+OCBarrage.h"
  10. #import "OCBarrageDescriptor.h"
  11. NS_ASSUME_NONNULL_BEGIN
  12. @protocol OCBarrageCellDelegate;
  13. @interface OCBarrageCell : UIView
  14. @property (nonatomic, assign, getter=isIdle) BOOL idle;//是否是空闲状态
  15. @property (nonatomic, assign) NSTimeInterval idleTime;//开始闲置的时间, 闲置超过5秒的, 自动回收内存
  16. @property (nonatomic, strong, nullable) OCBarrageDescriptor *barrageDescriptor;
  17. @property (nonatomic, strong, readonly, nullable) CAAnimation *barrageAnimation;
  18. @property (nonatomic, assign) int trackIndex;
  19. - (void)addBarrageAnimationWithDelegate:(id<CAAnimationDelegate>)animationDelegate;
  20. - (void)prepareForReuse;
  21. - (void)clearContents;
  22. - (void)updateSubviewsData;
  23. - (void)layoutContentSubviews;
  24. - (void)convertContentToImage;
  25. - (void)sizeToFit;//设置好数据之后调用一下自动计算bounds
  26. - (void)removeSubViewsAndSublayers;//默认删除所有的subview和sublayer; 如果需要选择性的删除可以重写这个方法.
  27. - (void)addBorderAttributes;
  28. @end
  29. @protocol OCBarrageCellDelegate <NSObject, CAAnimationDelegate>
  30. @optional
  31. @end
  32. NS_ASSUME_NONNULL_END