RQExerciseAnswerCell.m 1.1 KB

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