// // NYBlockExerciseHeaderView.m // jiaPei // // Created by Ning.ge on 2024/12/5. // Copyright © 2024 JCZ. All rights reserved. // #import "NYBlockExerciseHeaderView.h" @interface NYBlockExerciseHeaderView () @property (nonatomic, readwrite, strong) NYBlockExerciseGroupViewModel *viewModel; @end @implementation NYBlockExerciseHeaderView + (instancetype)reusableViewWithCollectionView:(UICollectionView *)collectionView OfKind:(NSString *)elementKind forIndexPath:(NSIndexPath *)indexPath { NSString *ID = [NSString stringWithFormat:@"%@%@", @"NYBlockExerciseHeaderView",elementKind]; [collectionView registerNib:[UINib nibWithNibName:@"NYBlockExerciseHeaderView" bundle:nil] forSupplementaryViewOfKind:elementKind withReuseIdentifier:ID]; NYBlockExerciseHeaderView *reusableView = [collectionView dequeueReusableSupplementaryViewOfKind:elementKind withReuseIdentifier:ID forIndexPath:indexPath]; if (!reusableView) reusableView = [self rq_viewFromXib]; return reusableView; } - (void)bindViewModel:(NYBlockExerciseGroupViewModel *)viewModel { self.viewModel = viewModel; self.name_label.text = viewModel.header; self.des_label.text = viewModel.headerDesStr; if(viewModel.star>0){ for(int i=0;i