RADetailSingleLineCell.m 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // RADetailSingleLineCell.m
  3. // Apex And Drivers
  4. //
  5. // Created by Jack on 2018/6/2.
  6. // Copyright © 2018年 USAI. All rights reserved.
  7. //
  8. #import "RADetailSingleLineCell.h"
  9. #import "RADetailSingleLineModel.h"
  10. @interface RADetailSingleLineCell ()
  11. @property (strong, nonatomic) IBOutlet UILabel *titleLable;
  12. @property (strong, nonatomic) IBOutlet UITextView *valueLabel;
  13. @end
  14. @implementation RADetailSingleLineCell
  15. - (void)awakeFromNib {
  16. [super awakeFromNib];
  17. // Initialization code
  18. self.valueLabel.textContainerInset = UIEdgeInsetsMake(0, -5, 0, -5);
  19. }
  20. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  21. [super setSelected:selected animated:animated];
  22. // Configure the view for the selected state
  23. }
  24. - (void)prepareForReuse {
  25. [super prepareForReuse];
  26. self.model = nil;
  27. }
  28. - (void)setModel:(RADetailSingleLineModel *)model {
  29. _model = model;
  30. self.titleLable.text = _model.title;
  31. self.valueLabel.text = _model.value;
  32. if (_model.highlight) {
  33. self.valueLabel.textColor = [UIColor redColor];
  34. } else{
  35. self.valueLabel.textColor = [UIColor blackColor];
  36. }
  37. }
  38. @end