DKPhotoPickerFooterCollectionReusableView.m 838 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // FooterCollectionReusableView.m
  3. // DKAssetsPickerDemo
  4. //
  5. //
  6. #import "DKPhotoPickerFooterCollectionReusableView.h"
  7. #import "UIView+Extension.h"
  8. @interface DKPhotoPickerFooterCollectionReusableView ()
  9. @property (weak, nonatomic) UILabel *footerLabel;
  10. @end
  11. @implementation DKPhotoPickerFooterCollectionReusableView
  12. - (UILabel *)footerLabel{
  13. if (!_footerLabel) {
  14. UILabel *footerLabel = [[UILabel alloc] init];
  15. footerLabel.frame = self.bounds;
  16. footerLabel.textAlignment = NSTextAlignmentCenter;
  17. [self addSubview:footerLabel];
  18. self.footerLabel = footerLabel;
  19. }
  20. return _footerLabel;
  21. }
  22. - (void)setCount:(NSInteger)count{
  23. _count = count;
  24. if (count > 0) {
  25. self.footerLabel.text = [NSString stringWithFormat:@"有 %ld 张图片", (long)count];
  26. }
  27. }
  28. @end