XG_AlbumCell.m 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // XG_AlbumCell.m
  3. // MyApp
  4. //
  5. // Created by huxinguang on 2018/9/26.
  6. // Copyright © 2018年 huxinguang. All rights reserved.
  7. //
  8. #import "XG_AlbumCell.h"
  9. #import "XG_AssetPickerManager.h"
  10. #import "XG_PickerMacro.h"
  11. @implementation XG_AlbumCell
  12. - (void)awakeFromNib {
  13. [super awakeFromNib];
  14. // Initialization code
  15. }
  16. - (void)setModel:(XG_AlbumModel *)model{
  17. _model = model;
  18. self.albumNameLabel.text = [NSString stringWithFormat:@"%@(%d)",model.name,(int)model.result.count];
  19. if (model.result.count > 0) {
  20. [[XG_AssetPickerManager manager] getPostImageWithAlbumModel:model completion:^(UIImage *postImage) {
  21. self.imgView.image = postImage;
  22. }];
  23. }else{
  24. self.imgView.image = ImageWithFile(@"picker_album_placeholder");
  25. }
  26. if (model.isSelected) {
  27. self.contentView.backgroundColor = [UIColor whiteColor];
  28. }else{
  29. self.contentView.backgroundColor = [UIColor whiteColor];
  30. }
  31. }
  32. -(void)prepareForReuse{
  33. self.imgView.image = nil;
  34. [super prepareForReuse];
  35. }
  36. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  37. [super setSelected:selected animated:animated];
  38. // Configure the view for the selected state
  39. }
  40. @end