Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 4f67050

Browse files
author
Bin Liu
committed
Fix another typo, fix build failure
1 parent 82c098b commit 4f67050

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

AsyncDisplayKit/ASButtonNode.mm

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ @interface ASButtonNode ()
1717

1818
NSAttributedString *_normalAttributedTitle;
1919
NSAttributedString *_highlightedAttributedTitle;
20-
NSAttributedString *_seletedAttributedTitle;
20+
NSAttributedString *_selectedAttributedTitle;
2121
NSAttributedString *_disabledAttributedTitle;
2222

2323
UIImage *_normalImage;
@@ -88,8 +88,8 @@ - (void)updateTitle
8888
newTitle = _disabledAttributedTitle;
8989
} else if (self.highlighted && _highlightedAttributedTitle) {
9090
newTitle = _highlightedAttributedTitle;
91-
} else if (self.selected && _seletedAttributedTitle) {
92-
newTitle = _seletedAttributedTitle;
91+
} else if (self.selected && _selectedAttributedTitle) {
92+
newTitle = _selectedAttributedTitle;
9393
} else {
9494
newTitle = _normalAttributedTitle;
9595
}
@@ -143,10 +143,13 @@ - (NSAttributedString *)attributedTitleForState:(ASControlState)state
143143
return _highlightedAttributedTitle;
144144

145145
case ASControlStateSelected:
146-
return _seletedAttributedTitle;
146+
return _selectedAttributedTitle;
147147

148148
case ASControlStateDisabled:
149149
return _disabledAttributedTitle;
150+
151+
default:
152+
return _normalAttributedTitle;
150153
}
151154
}
152155

@@ -163,12 +166,15 @@ - (void)setAttributedTitle:(NSAttributedString *)title forState:(ASControlState)
163166
break;
164167

165168
case ASControlStateSelected:
166-
_seletedAttributedTitle = [title copy];
169+
_selectedAttributedTitle = [title copy];
167170
break;
168171

169172
case ASControlStateDisabled:
170173
_disabledAttributedTitle = [title copy];
171174
break;
175+
176+
default:
177+
break;
172178
}
173179
[self updateTitle];
174180
}
@@ -188,6 +194,9 @@ - (UIImage *)imageForState:(ASControlState)state
188194

189195
case ASControlStateDisabled:
190196
return _disabledImage;
197+
198+
default:
199+
return _normalImage;
191200
}
192201
}
193202

@@ -210,6 +219,9 @@ - (void)setImage:(UIImage *)image forState:(ASControlState)state
210219
case ASControlStateDisabled:
211220
_disabledImage = image;
212221
break;
222+
223+
default:
224+
break;
213225
}
214226
[self updateImage];
215227
}

0 commit comments

Comments
 (0)