// // RQHomePageOneOrFourBigCell.m // jiaPei // // Created by 张嵘 on 2022/6/10. // Copyright © 2022 JCZ. All rights reserved. // #import "RQHomePageOneOrFourBigCell.h" @interface RQHomePageOneOrFourBigCell () @property (nonatomic, readwrite, strong) RQHomePageOneOrFourBigItemViewModel *viewModel; @property (weak, nonatomic) IBOutlet UILabel *mtTitleLabel; @property (weak, nonatomic) IBOutlet UIImageView *myBgImageView; @property (weak, nonatomic) IBOutlet UIStackView *leftStackView; @property (weak, nonatomic) IBOutlet UILabel *leftLabel; @property (weak, nonatomic) IBOutlet UILabel *rightLabel; @end @implementation RQHomePageOneOrFourBigCell #pragma mark - PublicMethods + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath { static NSString *ID = @"RQHomePageOneOrFourBigCell"; [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID]; RQHomePageOneOrFourBigCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath]; if (!cell) cell = [self rq_viewFromXib]; return cell; } - (void)bindViewModel:(RQHomePageOneOrFourBigItemViewModel *)viewModel { _viewModel = viewModel; _mtTitleLabel.text = viewModel.title; _myBgImageView.image = RQImageNamed(viewModel.icon); RAC(self.leftLabel, attributedText) = [[RACObserve(viewModel, leftStr) takeUntil:self.rac_prepareForReuseSignal] deliverOnMainThread]; RAC(self.rightLabel, attributedText) = [[RACObserve(viewModel, rightStr) takeUntil:self.rac_prepareForReuseSignal] deliverOnMainThread]; } #pragma mark - SystemMethods - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } @end