// // HSQFindTopCollectionViewCell.m // YouHuiProject // // Created by xiaoxi on 2018/1/19. // Copyright © 2018年 kuxuan. All rights reserved. // #import "HSQFindTopCollectionViewCell.h" @implementation HSQFindTopCollectionViewCell - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.layer.cornerRadius = 3; self.layer.masksToBounds = YES; [self initSubviews]; } return self; } - (void)initSubviews { [self.contentView.layer addSublayer:self.pictureLayer]; } - (void)setModel:(HSQFindHotSearchModel *)model { _model = model; [self.pictureLayer yy_setImageWithURL:[NSURL URLWithString:model.icon] options:YYWebImageOptionProgressiveBlur | YYWebImageOptionSetImageWithFadeAnimation]; } #pragma mark - lazy - (CALayer *)pictureLayer { if (!_pictureLayer) { _pictureLayer = [CALayer layer]; _pictureLayer.frame = CGRectMake(0, 0, FITSIZE(108), FITSIZE(75)); _pictureLayer.backgroundColor = [UIColor clearColor].CGColor; } return _pictureLayer; } @end