// // DetailOnlyTextCell.m // model // // Created by MUMEI on 2018/8/6. // Copyright © 2018年 Mine. All rights reserved. // #import "DetailOnlyTextCell.h" @implementation DetailOnlyTextCell - (void)awakeFromNib { [super awakeFromNib]; UITapGestureRecognizer *Tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(toImage:)];; [self.delLabel addGestureRecognizer:Tap]; self.delLabel.userInteractionEnabled = YES; // [self setDetail]; // Initialization code } - (void)toImage:(UITapGestureRecognizer*)recognizer { [self.delegate delPrivate:_model.privatepk]; } - (void)setModel:(PrivateModel *)model{ _model = model; [self setDetail]; } - (void)setName:(NSString *)name{ self.nameLabel.text = name; } - (void)setIcon:(NSString *)icon{ [self.iconImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",imageURl,icon]] placeholderImage:[UIImage imageNamed:@"jiazai"]]; } #pragma mark - labelTwo SizeToFitHeight - (void)setDetail { self.introLabel.text = _model.intro; self.introLabel.font = [UIFont systemFontOfSize:15]; self.introLabel.numberOfLines = 0; CGFloat height = [UILabel getHeightByWidth:self.introLabel.frame.size.width title:self.introLabel.text font:self.introLabel.font]; self.introLabel.frame = CGRectMake(64, 36, 295, height); self.dataLabel.text = _model.pdate; self.dataLabel.font = [UIFont systemFontOfSize:15]; self.dataLabel.numberOfLines = 0; CGFloat width = [UILabel getWidthWithTitle:self.dataLabel.text font:self.dataLabel.font]; self.dataWidth.constant = width; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; } @end