// // RQLearningMaterialsListCell.m // SDJK // // Created by 张嵘 on 2022/6/30. // #import "RQLearningMaterialsListCell.h" @interface RQLearningMaterialsListCell () @property (nonatomic, readwrite, strong) RQLearningMaterialsItemViewModel *viewModel; @property (weak, nonatomic) IBOutlet UILabel *myTitleLabel; @property (weak, nonatomic) IBOutlet QMUIButton *studyBtn; @property (weak, nonatomic) IBOutlet UIButton *iconAndTextBtn; @end @implementation RQLearningMaterialsListCell #pragma mark - PublicMethods + (instancetype)cellWithTableView:(UITableView *)tableView { static NSString *ID = @"RQLearningMaterialsListCell"; RQLearningMaterialsListCell *cell = [tableView dequeueReusableCellWithIdentifier:ID]; if (!cell) { cell = [self rq_viewFromXib]; cell.selectionStyle = UITableViewCellSelectionStyleNone; [cell.studyBtn setBackgroundImage:[UIImage imageWithQQCorner:^(QQCorner *corner) { corner.borderColor = RQ_MAIN_COLOR; corner.borderWidth = 1; corner.fillColor = UIColor.whiteColor; corner.radius = QQRadiusMakeSame(RQ_FIT_HORIZONTAL(24.f) / 2.f); } size:CGSizeMake(RQ_FIT_HORIZONTAL(72.f), RQ_FIT_HORIZONTAL(24.f))] forState:UIControlStateNormal]; [cell.iconAndTextBtn setBackgroundImage:[UIImage imageWithQQCorner:^(QQCorner *corner) { corner.borderColor = RQ_MAIN_TEXT_COLOR_2; corner.borderWidth = 1; corner.fillColor = UIColor.whiteColor; corner.radius = QQRadiusMakeSame(3.f); } size:CGSizeMake(RQ_FIT_HORIZONTAL(30.f), RQ_FIT_HORIZONTAL(16.f))] forState:UIControlStateNormal]; } return cell; } - (void)bindViewModel:(RQLearningMaterialsItemViewModel *)viewModel { _viewModel = viewModel; self.myTitleLabel.text = viewModel.title; } #pragma mark - SystemMethods - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end