RASettingActionCell.m 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // RASettingActionCell.m
  3. // Apex And Drivers
  4. //
  5. // Created by Jack on 2018/9/12.
  6. // Copyright © 2018年 USAI. All rights reserved.
  7. //
  8. #import "RASettingActionCell.h"
  9. #import "RASettingActionModel.h"
  10. @interface RASettingActionCell ()
  11. @property (nonatomic,strong) IBOutlet UILabel *titleLabel;
  12. @property (nonatomic,strong) IBOutlet UIActivityIndicatorView *activityIndicator;
  13. @property (nonatomic,strong) IBOutlet UILabel *sizeLabel;
  14. @end
  15. @implementation RASettingActionCell
  16. - (void)awakeFromNib {
  17. [super awakeFromNib];
  18. // Initialization code
  19. self.activityIndicator.tintColor = ApexDriverOrangeColor;
  20. }
  21. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  22. [super setSelected:selected animated:animated];
  23. // Configure the view for the selected state
  24. }
  25. - (void)refreshUI {
  26. RASettingActionModel *model = (RASettingActionModel *)self.model;
  27. NSString *title = model.title;
  28. BOOL active = model.active;
  29. self.titleLabel.text = title;
  30. if (active) {
  31. [self.activityIndicator startAnimating];
  32. self.sizeLabel.hidden = YES;
  33. } else{
  34. [self.activityIndicator stopAnimating];
  35. self.sizeLabel.hidden = NO;
  36. }
  37. self.sizeLabel.text = model.detail;
  38. }
  39. @end