Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Feature/checkbox update #15

Merged
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Example/MLBooleanWidget/MLBooleanWidgetViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ @interface MLBooleanWidgetViewController () <MLBooleanWidgetDelegate>

@property (weak, nonatomic) IBOutlet MLCheckBox *mlCheckBox1;
@property (weak, nonatomic) IBOutlet MLCheckBox *mlCheckBox2;
@property (weak, nonatomic) IBOutlet MLCheckBox *mlCheckBox3;

@property (weak, nonatomic) IBOutlet MLRadioButton *mlRadioButton1;
@property (weak, nonatomic) IBOutlet MLRadioButton *mlRadioButton2;
Expand All @@ -44,6 +45,7 @@ - (void)viewDidLoad
[self setupTitle];
[self setupCheckBox];
[self setupCheckBoxLabels];
[self setupControlCheckbox];
[self setupRadioButton];
[self setupOptionLabels];
[self setupSwitch];
Expand All @@ -60,6 +62,12 @@ - (void)setupCheckBox
self.mlCheckList = [MLCheckList checkListWithCheckBoxes:@[self.mlCheckBox1, self.mlCheckBox2]];
}

- (void)setupControlCheckbox
{
[self.mlCheckBox3 onAnimated:NO];
self.mlCheckBox3.delegate = self;
}

- (void)setupCheckBoxLabels
{
[self.checkBox1Label addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(checkBoxButton1DidTouch:)]];
Expand All @@ -86,6 +94,11 @@ - (void)setupSwitch
- (void)booleanWidgetDidRequestChangeOfState:(MLBooleanWidget *)booleanWidget
{
[booleanWidget toggleAnimated:YES];

if (booleanWidget == self.mlCheckBox3) {
[self.mlCheckBox1 setEnabled:booleanWidget.isOn Animated:YES];
[self.mlCheckBox2 setEnabled:booleanWidget.isOn Animated:YES];
}
}

#pragma mark - Actions
Expand Down
Loading