// // NYBlockExerciseCell.m // jiaPei // // Created by Ning.ge on 2024/12/5. // Copyright © 2024 JCZ. All rights reserved. // #import "NYBlockExerciseCell.h" @interface NYBlockExerciseCell () @property (nonatomic, readwrite, strong) NYBlockExerciseItemModel *viewModel; @end @implementation NYBlockExerciseCell #pragma mark - PublicMethods + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath { static NSString *ID = @"NYBlockExerciseCell"; [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID]; NYBlockExerciseCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath]; if (!cell) cell = [self rq_viewFromXib]; return cell; } - (void)bindViewModel:(NYBlockExerciseItemModel *)viewModel { self.viewModel = viewModel; RAC(self.leftStr_label, text) = [[RACObserve(viewModel, leftStr) deliverOnMainThread] takeUntil:self.rac_prepareForReuseSignal]; RAC(self.right_btn, selected) = [[RACObserve(viewModel, isfinish) deliverOnMainThread] takeUntil:self.rac_prepareForReuseSignal]; RAC(self.progress_view, progress) = [[RACObserve(viewModel, progress) deliverOnMainThread] takeUntil:self.rac_prepareForReuseSignal]; RAC(self.progress_label, text) = [[RACObserve(viewModel, progressStr) deliverOnMainThread] takeUntil:self.rac_prepareForReuseSignal]; } #pragma mark - SystemMethods - (void)awakeFromNib { [super awakeFromNib]; } @end