// // RQHomeSubPageNormalCell.m // jiaPei // // Created by 张嵘 on 2021/12/13. // Copyright © 2021 JCZ. All rights reserved. // #import "RQHomeSubPageNormalCell.h" @interface RQHomeSubPageNormalCell () @property (nonatomic, readwrite, strong) RQHomeSubPageNormalItemViewModel *viewModel; @property (weak, nonatomic) IBOutlet UIImageView *myIconImageView; @property (weak, nonatomic) IBOutlet UILabel *myTitleLabel; @property (weak, nonatomic) IBOutlet UIView *bottomLine; @end @implementation RQHomeSubPageNormalCell #pragma mark - PublicMethods + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath { static NSString *ID = @"RQHomeSubPageNormalCell"; [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID]; RQHomeSubPageNormalCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath]; if (!cell) cell = [self rq_viewFromXib]; return cell; } - (void)bindViewModel:(RQHomeSubPageNormalItemViewModel *)viewModel { _viewModel = viewModel; _myTitleLabel.text = viewModel.title; _myIconImageView.image = [UIImage imageNamed:viewModel.icon]; _bottomLine.hidden = viewModel.bottomLineHide; } - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } @end