NYTimeRuleCell.m 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // NYTimeRuleCell.m
  3. // jiaPei
  4. //
  5. // Created by Ning.ge on 2023/6/8.
  6. // Copyright © 2023 JCZ. All rights reserved.
  7. //
  8. #import "NYTimeRuleCell.h"
  9. @interface NYTimeRuleCell ()
  10. @property (nonatomic, readwrite, strong) NYTimeRuleItemViewModel *viewModel;
  11. @end
  12. @implementation NYTimeRuleCell
  13. #pragma mark - PublicMethods
  14. + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
  15. static NSString *ID = @"NYTimeRuleCell";
  16. [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID];
  17. NYTimeRuleCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
  18. if (!cell) cell = [self rq_viewFromXib];
  19. return cell;
  20. }
  21. - (void)bindViewModel:(NYTimeRuleItemViewModel *)viewModel {
  22. self.viewModel = viewModel;
  23. }
  24. #pragma mark - SystemMethods
  25. - (void)awakeFromNib {
  26. [super awakeFromNib];
  27. self.contentView.backgroundColor = UIColorHex(0x498EF5);
  28. self.ruleOne.layer.backgroundColor = [UIColor colorWithRed:65025/255.0 green:65025/255.0 blue:65025/255.0 alpha:1.0].CGColor;
  29. self.ruleOne.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.1600].CGColor;
  30. self.ruleTwo.layer.backgroundColor = [UIColor colorWithRed:65025/255.0 green:65025/255.0 blue:65025/255.0 alpha:1.0].CGColor;
  31. self.ruleTwo.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.1600].CGColor;
  32. self.ruleThree.layer.backgroundColor = [UIColor colorWithRed:65025/255.0 green:65025/255.0 blue:65025/255.0 alpha:1.0].CGColor;
  33. self.ruleThree.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.1600].CGColor;
  34. self.ruleFour.layer.backgroundColor = [UIColor colorWithRed:65025/255.0 green:65025/255.0 blue:65025/255.0 alpha:1.0].CGColor;
  35. self.ruleFour.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.1600].CGColor;
  36. self.ruleMsg.layer.backgroundColor = [UIColor colorWithRed:65025/255.0 green:65025/255.0 blue:65025/255.0 alpha:1.0].CGColor;
  37. self.ruleMsg.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.1600].CGColor;
  38. }
  39. @end