YOUPAIOCBarrageMixedImageAndTextCell.m 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // YOUPAIOCBarrageMixedImageAndTextCell.m
  3. // OCBarrage
  4. //
  5. // Created by QMTV on 2017/8/31.
  6. // Copyright © 2017年 LFC. All rights reserved.
  7. //
  8. #import "YOUPAIOCBarrageMixedImageAndTextCell.h"
  9. @implementation YOUPAIOCBarrageMixedImageAndTextCell
  10. - (instancetype)init {
  11. self = [super init];
  12. if (self) {
  13. [self addSubviews];
  14. }
  15. return self;
  16. }
  17. - (void)prepareForReuse {
  18. [super prepareForReuse];
  19. self.miaxedImageAndTextLabel.attributedText = nil;
  20. }
  21. - (void)addSubviews {
  22. [self addSubview:self.miaxedImageAndTextLabel];
  23. }
  24. - (void)youpaifupdateSubviewsData {
  25. self.miaxedImageAndTextLabel.attributedText = self.textDescriptor.attributedText;
  26. }
  27. - (void)youpaiflayoutContentSubviews {
  28. CGSize cellSize = [self.miaxedImageAndTextLabel sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)];
  29. self.miaxedImageAndTextLabel.frame = CGRectMake(0.0, 0.0, cellSize.width, cellSize.height);
  30. }
  31. - (void)removeSubViewsAndSublayers {
  32. }
  33. #pragma mark --- getter
  34. - (YYLabel *)miaxedImageAndTextLabel {
  35. if (!_miaxedImageAndTextLabel) {
  36. _miaxedImageAndTextLabel = [[YYLabel alloc] init];
  37. }
  38. return _miaxedImageAndTextLabel;
  39. }
  40. @end