RQFreeTryNoteCell.m 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // RQFreeTryNoteCell.m
  3. // SDJK
  4. //
  5. // Created by 张嵘 on 2022/6/28.
  6. //
  7. #import "RQFreeTryNoteCell.h"
  8. @interface RQFreeTryNoteCell ()
  9. @property (nonatomic, readwrite, strong) RQFreeTryNoteItemViewModel *viewModel;
  10. @property (weak, nonatomic) IBOutlet UILabel *myTitleLabel;
  11. @property (weak, nonatomic) IBOutlet UIImageView *myBgImageView;
  12. @end
  13. @implementation RQFreeTryNoteCell
  14. #pragma mark - PublicMethods
  15. + (instancetype)cellWithTableView:(UITableView *)tableView {
  16. static NSString *ID = @"RQFreeTryNoteCell";
  17. RQFreeTryNoteCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
  18. if (!cell) {
  19. cell = [self rq_viewFromXib];
  20. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  21. }
  22. return cell;
  23. }
  24. - (void)bindViewModel:(RQFreeTryNoteItemViewModel *)viewModel {
  25. _viewModel = viewModel;
  26. _myTitleLabel.text = viewModel.title;
  27. _myBgImageView.image = RQImageNamed(viewModel.icon);
  28. }
  29. #pragma mark - SystemMethods
  30. - (void)awakeFromNib {
  31. [super awakeFromNib];
  32. // Initialization code
  33. }
  34. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  35. [super setSelected:selected animated:animated];
  36. // Configure the view for the selected state
  37. }
  38. @end