123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- //
- // LDAdversementCell.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/1/25.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "LDAdversementCell.h"
- @interface LDAdversementCell ()
- @property (nonatomic, strong) UIImageView *iconView;
- @end
- @implementation LDAdversementCell
- + (instancetype)cellWithTableView:(UITableView *)tableView {
- static NSString *cellID = nil;
- cellID = NSStringFromClass([self class]);
- LDAdversementCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
- if (!cell) {
- cell = [[LDAdversementCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
- }
- return cell;
-
- }
- - (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
- }
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if (self) {
- [self.contentView addSubview:self.iconView];
-
- [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.top.right.bottom.mas_equalTo(0);
- }];
- }
- return self;
- }
- - (void)setModel:(LDChildGoodModel *)model {
- _model = model;
-
- [_iconView sd_setImageWithURL:[NSURL URLWithString:model.photo]];
- }
- - (UIImageView *)iconView {
- if (!_iconView) {
- _iconView = [[UIImageView alloc] init];
- _iconView.backgroundColor = [UIColor yhGrayColor];
- }
- return _iconView;
- }
- @end
|