NYLIVipHeaderImageViewNewReusableView.m 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // NYLIVipHeaderImageViewNewReusableView.m
  3. // jiaPei
  4. //
  5. // Created by Ning.ge on 2025/2/5.
  6. // Copyright © 2025 JCZ. All rights reserved.
  7. //
  8. #import "NYLIVipHeaderImageViewNewReusableView.h"
  9. @interface NYLIVipHeaderImageViewNewReusableView ()
  10. @property (nonatomic, readwrite, strong) NYLIVipHeaderImageViewGroupModel *viewModel;
  11. @end
  12. @implementation NYLIVipHeaderImageViewNewReusableView
  13. + (instancetype)reusableViewWithCollectionView:(UICollectionView *)collectionView OfKind:(NSString *)elementKind forIndexPath:(NSIndexPath *)indexPath {
  14. NSString *ID = [NSString stringWithFormat:@"%@%@", @"NYLIVipHeaderImageViewNewReusableView",elementKind];
  15. [collectionView registerNib:[UINib nibWithNibName:@"NYLIVipHeaderImageViewNewReusableView" bundle:nil] forSupplementaryViewOfKind:elementKind withReuseIdentifier:ID];
  16. NYLIVipHeaderImageViewNewReusableView *reusableView = [collectionView dequeueReusableSupplementaryViewOfKind:elementKind withReuseIdentifier:ID forIndexPath:indexPath];
  17. if (!reusableView) reusableView = [self rq_viewFromXib];
  18. return reusableView;
  19. }
  20. - (void)bindViewModel:(NYLIVipHeaderImageViewGroupModel *)viewModel {
  21. @weakify(self)
  22. _viewModel = viewModel;
  23. // [[RACObserve(viewModel, headerImageName) takeUntil:self.rac_prepareForReuseSignal] subscribeNext:^(id _Nullable x) {
  24. // @strongify(self)
  25. // self.headerImageView.image = RQImageNamed(viewModel.headerImageName);
  26. // }];
  27. }
  28. - (void)awakeFromNib {
  29. [super awakeFromNib];
  30. // Initialization code
  31. }
  32. @end