// // HomeMusicCell.m // smartRhino // // Created by niuzhen on 2020/5/15. // Copyright © 2020 tederen. All rights reserved. // #import "HomeMusicCell.h" #import "NSDate+Extension.h" @implementation HomeMusicCell - (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 } + (HomeMusicCell *)configCell:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{ static NSString *cellIdentifer = @"HomeMusicCell"; HomeMusicCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer]; if (cell == nil) { cell = [[[NSBundle mainBundle] loadNibNamed:@"HomeMusicCell" owner:nil options:nil] objectAtIndex:0]; } return cell; } - (void)setDataWithModel:(HomeSubItemModel *)model { [self.imagV sd_setImageWithURL:[NSURL URLWithString:model.ImageUrls] placeholderImage:IMG(@"img_placeHolder")]; self.titleL.text = model.Title; self.subTitleL.text = @""; self.soundContant.constant = 0.f; self.countL.text = [NSString stringWithFormat:@"%ld",model.ReadCount]; // self.timeL.text = model.Duration; } - (void)setDataWithModel:(HomeSubItemModel *)model searchText:(NSString *)text { [self.imagV sd_setImageWithURL:[NSURL URLWithString:model.ImageUrls] placeholderImage:IMG(@"img_placeHolder")]; self.titleL.attributedText = [ZYCTool checkOfString:model.Title withSearchText:text withColor:UIColorHex(0xFF5252)]; self.subTitleL.text = @""; self.titleL.numberOfLines = 1; self.soundContant.constant = 0.f; self.countL.text = [NSString stringWithFormat:@"%ld",model.ReadCount]; self.timeL.text = model.Duration; self.DateL.text = [NSDate getMonthAndDayWihtDate:model.CreatedDate]; } @end