// // GoodsBannerCollectionViewCell.m // westkissMob // // Created by 王猛 on 2022/9/14. // #import "GoodsBannerCollectionViewCell.h" @implementation GoodsBannerCollectionViewCell - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self tt_addSubViews]; } return self; } -(void)tt_addSubViews{ [self addSubview:self.imgV]; [self.imgV mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.top.bottom.mas_equalTo(0); }]; } -(void)setModel:(GoodsBannerModel *)model{ _model = model; if (model.cellType == CellContentTypeImg) { self.imgV.hidden = NO; [self.imgV sd_setImageWithURL:[NSURL URLWithString:model.url] placeholderImage:UIImageDefaultImg_SD]; } } -(UIImageView *)imgV{ if (!_imgV) { _imgV = [[UIImageView alloc]init]; _imgV.userInteractionEnabled = YES; } return _imgV; } @end