RADetailActionSubCell.m 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // RADetailActionSubCell.m
  3. // Apex And Drivers
  4. //
  5. // Created by Jack on 2018/6/2.
  6. // Copyright © 2018年 USAI. All rights reserved.
  7. //
  8. #import "RADetailActionSubCell.h"
  9. #import "RADetailActionModel.h"
  10. @interface RADetailActionSubCell ()
  11. @property (strong, nonatomic) IBOutlet UIButton *actionTitleBtn;
  12. @end
  13. @implementation RADetailActionSubCell
  14. - (void)awakeFromNib {
  15. [super awakeFromNib];
  16. self.layer.borderWidth = 0.5f;
  17. self.layer.borderColor = [UIColor darkGrayColor].CGColor;
  18. self.layer.cornerRadius = 5.0f;
  19. self.layer.masksToBounds = YES;
  20. }
  21. - (void)setModel:(RADetailActionModel *)model {
  22. _model = model;
  23. [self.actionTitleBtn setTitle:model.actionTitle forState:UIControlStateNormal];
  24. }
  25. - (void)prepareForReuse {
  26. [super prepareForReuse];
  27. self.model = nil;
  28. self.delegate = nil;
  29. }
  30. - (IBAction)actionBtnClick:(UIButton *)sender {
  31. if (self.delegate && [self.delegate respondsToSelector:@selector(actionSubCell:didClickForModel:)]) {
  32. [self.delegate actionSubCell:self didClickForModel:self.model];
  33. }
  34. }
  35. @end