Skip to content

Commit

Permalink
Fix zip selection
Browse files Browse the repository at this point in the history
  • Loading branch information
LIJI32 committed Sep 6, 2024
1 parent 92f4256 commit 8e3d8c4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions iOS/GBLoadROMTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
NSString *gbUTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)@"gb", NULL);
NSString *gbcUTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)@"gbc", NULL);
NSString *isxUTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)@"isx", NULL);

NSString *zipUTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)@"zip", NULL);

NSMutableSet *extensions = [NSMutableSet set];
[extensions addObjectsFromArray:(__bridge NSArray *)UTTypeCopyAllTagsWithClass((__bridge CFStringRef)gbUTI, kUTTagClassFilenameExtension)];
[extensions addObjectsFromArray:(__bridge NSArray *)UTTypeCopyAllTagsWithClass((__bridge CFStringRef)gbcUTI, kUTTagClassFilenameExtension)];
Expand All @@ -121,16 +122,15 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
return;
}
}

[extensions addObject:@"zip"];


[self.presentingViewController dismissViewControllerAnimated:true completion:^{
UIDocumentPickerViewController *picker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"com.github.liji32.sameboy.gb",
@"com.github.liji32.sameboy.gbc",
@"com.github.liji32.sameboy.isx",
gbUTI ?: @"",
gbcUTI ?: @"",
isxUTI ?: @""]
isxUTI ?: @"",
zipUTI ?: @""]
inMode:UIDocumentPickerModeImport];
picker.allowsMultipleSelection = true;
if (@available(iOS 13.0, *)) {
Expand Down

0 comments on commit 8e3d8c4

Please sign in to comment.