You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current implementation uses a generic and complex action sheet handler, which compares localized strings to determine the action to take. Alternative solution is to create a set of the actions:
In this case I would need to move the logic of what I am finally showing in the action sheet (currently a simple array of action strings which is majorly defined in AppDelegate) to the place where I am building the sheet. And ideally replacing the string in AppDelegate with enums. Something like this:
Examples in the current codebase are the implementations of (void)actionSheetHandler:(NSString*) in DetailViewController, ShowInfoViewController and NowPlaying. In these methods the actions are processed by patterns like
if ([actiontitle isEqualToString:LOCALIZED_STR(@"Queue after current")]) {
[self addQueueAfterCurrent:YES];
}
else if ([actiontitle isEqualToString:LOCALIZED_STR(@"Queue")]) {
[self addQueueAfterCurrent:NO];
}
...
The actions themselves are added by looping through a list of action strings in sheetActions:
Taken from review discussions in #1232.
Current implementation uses a generic and complex action sheet handler, which compares localized strings to determine the action to take. Alternative solution is to create a set of the actions:
In this case I would need to move the logic of what I am finally showing in the action sheet (currently a simple array of action strings which is majorly defined in AppDelegate) to the place where I am building the sheet. And ideally replacing the string in AppDelegate with enums. Something like this:
AppDelegate:
ViewController:
The text was updated successfully, but these errors were encountered: