口袋优选

KBTodayReatCollectionCell.m 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // KBTodayReatCollectionCell.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/7/23.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "KBTodayReatCollectionCell.h"
  9. @interface KBTodayReatCollectionCell ()
  10. @property (nonatomic, strong) UIImageView *icon;
  11. @end
  12. @implementation KBTodayReatCollectionCell
  13. - (instancetype)initWithFrame:(CGRect)frame {
  14. self = [super initWithFrame:frame];
  15. if (self) {
  16. [self.contentView addSubview:self.icon];
  17. [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
  18. make.edges.mas_equalTo(UIEdgeInsetsMake(0, 0, 0, 0));
  19. }];
  20. }
  21. return self;
  22. }
  23. - (UIImageView *)icon {
  24. if (!_icon) {
  25. _icon = [[UIImageView alloc] init];
  26. _icon.backgroundColor = [UIColor yhGrayColor];
  27. _icon.layer.cornerRadius = 4;
  28. _icon.layer.masksToBounds = YES;
  29. }
  30. return _icon;
  31. }
  32. - (void)setModel:(KBMorePicModel *)model {
  33. [self.icon sd_setImageWithURL:[NSURL URLWithString:model.img2]];
  34. }
  35. @end