Skip to content

Commit 05b6cfc

Browse files
committed
Formatting updates
1 parent 923ccd3 commit 05b6cfc

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Classes/BEMCheckBoxGroup.m

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ + (nonnull instancetype)groupWithCheckBoxes:(nullable NSArray<BEMCheckBox *> *)c
4646
}
4747

4848
- (void)addCheckBoxToGroup:(nonnull BEMCheckBox *)checkBox {
49-
if([checkBox group]){
49+
if ([checkBox group]) {
5050
// Already has a group, remove first
5151
[[checkBox group] removeCheckBoxFromGroup:checkBox];
5252
}
@@ -57,7 +57,7 @@ - (void)addCheckBoxToGroup:(nonnull BEMCheckBox *)checkBox {
5757
}
5858

5959
- (void)removeCheckBoxFromGroup:(nonnull BEMCheckBox *)checkBox {
60-
if(![self.checkBoxes containsObject:checkBox]){
60+
if (![self.checkBoxes containsObject:checkBox]) {
6161
// Not in this group
6262
return;
6363
}
@@ -81,11 +81,11 @@ - (BEMCheckBox *)selectedCheckBox {
8181
}
8282

8383
- (void)setSelectedCheckBox:(BEMCheckBox *)selectedCheckBox {
84-
if(selectedCheckBox){
85-
for (BEMCheckBox *b in self.checkBoxes) {
86-
BOOL shouldBeOn = (b == selectedCheckBox);
87-
if([b on] != shouldBeOn){
88-
[b _setOn:shouldBeOn animated:YES notifyGroup:NO];
84+
if (selectedCheckBox) {
85+
for (BEMCheckBox *checkBox in self.checkBoxes) {
86+
BOOL shouldBeOn = (checkBox == selectedCheckBox);
87+
if([checkBox on] != shouldBeOn){
88+
[checkBox _setOn:shouldBeOn animated:YES notifyGroup:NO];
8989
}
9090
}
9191
} else {
@@ -104,19 +104,19 @@ - (void)setSelectedCheckBox:(BEMCheckBox *)selectedCheckBox {
104104
}
105105
}
106106

107-
- (void)setMustHaveSelection:(BOOL)mustHaveSelection{
107+
- (void)setMustHaveSelection:(BOOL)mustHaveSelection {
108108
_mustHaveSelection = mustHaveSelection;
109109

110110
// If it must have a selection and we currently don't, select the first box
111-
if(mustHaveSelection && !self.selectedCheckBox){
111+
if (mustHaveSelection && !self.selectedCheckBox) {
112112
[self setSelectedCheckBox:[self.checkBoxes firstObject]];
113113
}
114114
}
115115

116116
#pragma mark Private methods called by BEMCheckBox
117117

118118
- (void)_checkBoxSelectionChanged:(BEMCheckBox *)checkBox {
119-
if([checkBox on]){
119+
if ([checkBox on]) {
120120
// Change selected checkbox to this one
121121
[self setSelectedCheckBox:checkBox];
122122
} else if(checkBox == self.selectedCheckBox) {

0 commit comments

Comments
 (0)