// // RASettingSwitchCell.m // Apex And Drivers // // Created by Jack on 2018/9/12. // Copyright © 2018年 USAI. All rights reserved. // #import "RASettingSwitchCell.h" #import "RASettingSwitchModel.h" @interface RASettingSwitchCell () @property (nonatomic,strong) IBOutlet UILabel *titleLabel; @property (nonatomic,strong) IBOutlet UISwitch *switchBtn; @end @implementation RASettingSwitchCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } - (void)refreshUI { RASettingSwitchModel *model = (RASettingSwitchModel *)self.model; NSString *title = model.title; BOOL switchValue = model.switchValue; self.titleLabel.text = title; self.switchBtn.on = switchValue; } - (IBAction)switchBtnClick:(UISwitch *)sender { RASettingSwitchModel *model = (RASettingSwitchModel *)self.model; model.switchValue = sender.isOn; } @end