/
githubmirror
/
omim
Обзор
Документация
Войти
/
githubmirror
/
omim
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
iphone/Maps/UI/Editor/Cells/MWMEditorSwitchTableViewCell.m
41 строка
1 KB
Alexander Boriskov
[iOS] Refactored old styles
12 фев 2020, 14:37
12 фев 2020, 14:37
91d7242
Код
Авторство
О чём код?
#import "MWMEditorSwitchTableViewCell.h" #import "SwiftBridge.h" @interface MWMEditorSwitchTableViewCell () @property(weak, nonatomic) IBOutlet UIImageView * icon; @property(weak, nonatomic) IBOutlet UILabel * label; @property(weak, nonatomic) IBOutlet UISwitch * switchControl; @property(weak, nonatomic) id<MWMEditorCellProtocol> delegate; @end @implementation MWMEditorSwitchTableViewCell - (void)configWithDelegate:(id<MWMEditorCellProtocol>)delegate icon:(UIImage *)icon text:(NSString *)text on:(BOOL)on { self.delegate = delegate; self.icon.image = icon; self.icon.styleName = @"MWMBlack"; self.label.text = text; self.switchControl.on = on; [self setTextColorWithSwitchValue:on]; } - (void)setTextColorWithSwitchValue:(BOOL)value { self.label.textColor = value ? [UIColor blackPrimaryText] : [UIColor blackHintText]; } - (IBAction)valueChanged { BOOL const value = self.switchControl.on; [self.delegate cell:self changeSwitch:value]; [self setTextColorWithSwitchValue:value]; } @end