123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- //
- // CoachArrangeClassCell.m
- // LN_School
- //
- // Created by 张嵘 on 2019/8/1.
- // Copyright © 2019 Danson. All rights reserved.
- //
- #import "CoachArrangeClassCell.h"
- #import "CoachArrangeClassModel.h"
- @interface CoachArrangeClassCell ()
- @property (nonatomic, readwrite, strong) UILabel *progressLabel;
- @property (nonatomic, readwrite, strong) UILabel *objectLabel;
- @property (nonatomic, readwrite, strong) UILabel *dateLabel;
- @end
- @implementation CoachArrangeClassCell
- #pragma mark - Life Cycle
- - (instancetype)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
- self.contentView.backgroundColor = UIColor.whiteColor;
- [self.contentView addSubview:self.progressLabel];
- [self.contentView addSubview:self.objectLabel];
- [self.contentView addSubview:self.dateLabel];
- }
- return self;
- }
- - (void)layoutSubviews {
- [super layoutSubviews];
-
- [_progressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.center.mas_equalTo(self.contentView);
- make.size.mas_equalTo(CGSizeMake(self.bounds.size.width / 3.f, self.bounds.size.height));
- }];
-
- [_dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_offset(0);
- make.centerY.mas_equalTo(self.contentView);
- make.size.mas_equalTo(_progressLabel);
- }];
- [_objectLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.mas_offset(0);
- make.centerY.mas_equalTo(self.contentView);
- make.size.mas_equalTo(_progressLabel);
- }];
- }
- #pragma mark - HDUpdateUIProtocol
- - (void)updateCellUI:(__kindof HDCellModel *)model {
- CoachArrangeClassModel *coachArrangeClassModel = model.orgData;
- _progressLabel.text = [NSString stringWithFormat:@"%@", coachArrangeClassModel.progress];
- _objectLabel.text = [NSString stringWithFormat:@"%@", coachArrangeClassModel.object];
- _dateLabel.text = [NSString stringWithFormat:@"%@", coachArrangeClassModel.date];
- }
- #pragma mark - Lazy Load
- - (UILabel *)progressLabel {
- if (!_progressLabel) {
- _progressLabel = [[UILabel alloc] init];
- _progressLabel.text = @"阶段三";
- _progressLabel.textAlignment = NSTextAlignmentCenter;
- _progressLabel.textColor = RQTitleTextColor;
- _progressLabel.numberOfLines = 0;
- _progressLabel.font = [UIFont systemFontOfSize:16];
- }
- return _progressLabel;
- }
- - (UILabel *)objectLabel {
- if (!_objectLabel) {
- _objectLabel = [[UILabel alloc] init];
- _objectLabel.text = @"实际操作";
- _objectLabel.textAlignment = NSTextAlignmentCenter;
- _objectLabel.textColor = RQTitleTextColor;
- _objectLabel.numberOfLines = 0;
- _objectLabel.font = [UIFont systemFontOfSize:16];
- }
- return _objectLabel;
- }
- - (UILabel *)dateLabel {
- if (!_dateLabel) {
- _dateLabel = [[UILabel alloc] init];
- _dateLabel.text = @"2019-09-09";
- _dateLabel.textAlignment = NSTextAlignmentCenter;
- _dateLabel.textColor = RQTitleTextColor;
- _dateLabel.numberOfLines = 0;
- _dateLabel.font = [UIFont systemFontOfSize:16];
- }
- return _dateLabel;
- }
- @end
|