RQErrorAndCollectCell.m 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // RQErrorAndCollectCell.m
  3. // jiaPei
  4. //
  5. // Created by 张嵘 on 2022/8/4.
  6. // Copyright © 2022 JCZ. All rights reserved.
  7. //
  8. #import "RQErrorAndCollectCell.h"
  9. @interface RQErrorAndCollectCell ()
  10. @property (nonatomic, readwrite, strong) RQErrorAndCollectItemViewModel *viewModel;
  11. @property (weak, nonatomic) IBOutlet UILabel *numLabel;
  12. @property (weak, nonatomic) IBOutlet UILabel *countNumLabel;
  13. @property (weak, nonatomic) IBOutlet UILabel *titleLabel;
  14. @end
  15. @implementation RQErrorAndCollectCell
  16. #pragma mark - PublicMethods
  17. + (instancetype)cellWithTableView:(UITableView *)tableView {
  18. static NSString *ID = @"RQErrorAndCollectCell";
  19. RQErrorAndCollectCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
  20. if (!cell) {
  21. cell = [self rq_viewFromXib];
  22. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  23. }
  24. return cell;
  25. }
  26. - (void)bindViewModel:(RQErrorAndCollectItemViewModel *)viewModel {
  27. _viewModel = viewModel;
  28. _numLabel.text = viewModel.numStr;
  29. _titleLabel.text = viewModel.titleStr;
  30. _countNumLabel.text = viewModel.countStr;
  31. }
  32. - (void)awakeFromNib {
  33. [super awakeFromNib];
  34. _numLabel.layer.cornerRadius = RQ_FIT_HORIZONTAL(28.f) / 2.f;
  35. }
  36. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  37. [super setSelected:selected animated:animated];
  38. // Configure the view for the selected state
  39. }
  40. @end