RQProfileLogoutCell.m 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // RQProfileLogoutCell.m
  3. // JSJP
  4. //
  5. // Created by 张嵘 on 2021/8/2.
  6. //
  7. #import "RQProfileLogoutCell.h"
  8. @interface RQProfileLogoutCell ()
  9. @property (nonatomic, readwrite, strong) RQProfileLogouItemViewModel *viewModel;
  10. @property (weak, nonatomic) IBOutlet UIButton *logoutBtn;
  11. @end
  12. @implementation RQProfileLogoutCell
  13. #pragma mark - PublicMethods
  14. + (instancetype)cellWithTableView:(UITableView *)tableView {
  15. static NSString *ID = @"RQProfileLogoutCell";
  16. RQProfileLogoutCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
  17. if (!cell) {
  18. cell = [self rq_viewFromXib];
  19. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  20. }
  21. cell.logoutBtn.layer.cornerRadius = RQ_FIT_HORIZONTAL(40.f) / 2.f;
  22. return cell;
  23. }
  24. - (void)bindViewModel:(RQProfileLogouItemViewModel *)viewModel {
  25. _viewModel = viewModel;
  26. }
  27. #pragma mark - SystemMethods
  28. - (void)awakeFromNib {
  29. [super awakeFromNib];
  30. }
  31. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  32. [super setSelected:selected animated:animated];
  33. // Configure the view for the selected state
  34. }
  35. - (IBAction)logoutAction:(id)sender {
  36. // [_viewModel.logoutCommand execute:nil];
  37. [_viewModel.logoutSubject sendNext:nil];
  38. }
  39. @end