// // NYLIVipAuthorityNewCell.m // jiaPei // // Created by Ning.ge on 2025/2/6. // Copyright © 2025 JCZ. All rights reserved. // #import "NYLIVipAuthorityNewCell.h" @interface NYLIVipAuthorityNewCell () @property (nonatomic, readwrite, strong) NYLIVipAuthorityNewItemViewModel *viewModel; @property (weak, nonatomic) IBOutlet UIImageView *bgImageView; @property (weak, nonatomic) IBOutlet UILabel *title_label01; @property (weak, nonatomic) IBOutlet UILabel *title_label02; @property (weak, nonatomic) IBOutlet UILabel *title_label03; @end @implementation NYLIVipAuthorityNewCell #pragma mark - PublicMethods + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath { static NSString *ID = @"NYLIVipAuthorityNewCell"; [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID]; NYLIVipAuthorityNewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath]; if (!cell) cell = [self rq_viewFromXib]; return cell; } - (void)bindViewModel:(NYLIVipAuthorityNewItemViewModel *)viewModel { @weakify(self) _viewModel = viewModel; [[[RACObserve(viewModel, bgImageName) deliverOnMainThread] takeUntil:self.rac_prepareForReuseSignal] subscribeNext:^(id _Nullable x) { @strongify(self) self.bgImageView.image = RQImageNamed(viewModel.bgImageName); }]; RAC(self.title_label01, text) = [[RACObserve(viewModel, authorityTitle) takeUntil:self.rac_prepareForReuseSignal] deliverOnMainThread]; RAC(self.title_label02, text) = [[RACObserve(viewModel, authorityTitle01) takeUntil:self.rac_prepareForReuseSignal] deliverOnMainThread]; RAC(self.title_label03, text) = [[RACObserve(viewModel, authorityTitle02) takeUntil:self.rac_prepareForReuseSignal] deliverOnMainThread]; } #pragma mark - SystemMethods - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } @end