WFCUGeneralImageTextTableViewCell.m 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // WFCUGeneralImageTextTableViewCell.m
  3. // WFChatUIKit
  4. //
  5. // Created by Rain on 2023/4/20.
  6. // Copyright © 2023 Tom Lee. All rights reserved.
  7. //
  8. #import "WFCUGeneralImageTextTableViewCell.h"
  9. @interface WFCUGeneralImageTextTableViewCell ()
  10. @property(nonatomic, assign)float cellHeight;
  11. @end
  12. @implementation WFCUGeneralImageTextTableViewCell
  13. - (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier cellHeight:(float)height {
  14. self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
  15. self.cellHeight = height;
  16. return self;
  17. }
  18. - (UIImageView *)portraitIV {
  19. if (!_portraitIV) {
  20. _portraitIV = [[UIImageView alloc] initWithFrame:CGRectMake(8, 8, self.cellHeight - 16, self.cellHeight - 16)];
  21. _portraitIV.layer.masksToBounds = YES;
  22. _portraitIV.layer.cornerRadius = 4;
  23. [self addSubview:_portraitIV];
  24. }
  25. return _portraitIV;
  26. }
  27. - (UILabel *)titleLable {
  28. if (!_titleLable) {
  29. _titleLable = [[UILabel alloc] initWithFrame:CGRectMake(self.cellHeight, 0, self.bounds.size.width-self.cellHeight, self.cellHeight)];
  30. [self addSubview:_titleLable];
  31. }
  32. return _titleLable;
  33. }
  34. @end