2
0

WFCFavoriteTextCell.m 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // WFCFavoriteUnknownCell.m
  3. // WildFireChat
  4. //
  5. // Created by Tom Lee on 2020/11/1.
  6. // Copyright © 2020 WildFireChat. All rights reserved.
  7. //
  8. #import "WFCFavoriteTextCell.h"
  9. @interface WFCFavoriteTextCell ()
  10. @property(nonatomic, strong)UILabel *label;
  11. @end
  12. @implementation WFCFavoriteTextCell
  13. - (void)awakeFromNib {
  14. [super awakeFromNib];
  15. // Initialization code
  16. }
  17. - (void)setFavoriteItem:(WFCUFavoriteItem *)favoriteItem {
  18. [super setFavoriteItem:favoriteItem];
  19. self.label.frame = self.contentArea.bounds;
  20. self.label.text = favoriteItem.title;
  21. }
  22. + (CGFloat)contentHeight:(WFCUFavoriteItem *)favoriteItem {
  23. return [WFCUUtilities getTextDrawingSize:favoriteItem.title font:[UIFont systemFontOfSize:18] constrainedSize:CGSizeMake([UIScreen mainScreen].bounds.size.width-16, 1000)].height;
  24. }
  25. - (UILabel *)label {
  26. if (!_label) {
  27. _label = [[UILabel alloc] init];
  28. _label.font = [UIFont systemFontOfSize:18];
  29. _label.numberOfLines = 0;
  30. [self.contentArea addSubview:_label];
  31. }
  32. return _label;;
  33. }
  34. @end