RQExerciseAnswerCell.m 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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.font = [UIFont systemFontOfSize:RQ_Exercise_Module.exerciseFontSize];
  26. _answerLabel.text = viewModel.answerString;
  27. }
  28. #pragma mark - SystemMethods
  29. - (void)awakeFromNib {
  30. [super awakeFromNib];
  31. // Initialization code
  32. }
  33. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  34. [super setSelected:selected animated:animated];
  35. // Configure the view for the selected state
  36. }
  37. @end