123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- //
- // 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
|