Slot selectValue - return BOOL to indicate if selected.

This commit is contained in:
Kelvin Sherlock 2023-12-02 14:49:03 -05:00
parent b728ae7f49
commit 5227868b79
2 changed files with 4 additions and 3 deletions

View File

@ -42,7 +42,7 @@ typedef enum SlotType {
-(void)reset;
-(void)prepareView: (SlotTableCellView *)view;
-(void)selectValue: (NSString *)value;
-(BOOL)selectValue: (NSString *)value;
-(Media)selectedMedia;

View File

@ -96,18 +96,19 @@ static NSDictionary *TypeMap = nil;
}
}
-(void)selectValue: (NSString *)value {
-(BOOL)selectValue: (NSString *)value {
if (value) {
NSInteger index = 0;
for (SlotOption *item in _options) {
if ([[item value] isEqualToString: value]) {
[self setSelectedIndex: index];
return;
return YES;
}
++index;
}
}
return NO;
//[self setSelectedIndex: _defaultIndex >= 0 ? _defaultIndex : 0];
}