git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 795d772c8345e1643d6df6055655c5e59e338517
parent 2b2bb3569bc260bd53a2092c00657aca67845c6a
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Sun, 18 Aug 2024 19:28:27 +0300

Allow deleting ROMs from the context menu in the iOS version

Diffstat:
MiOS/GBLoadROMTableViewController.m10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/iOS/GBLoadROMTableViewController.m b/iOS/GBLoadROMTableViewController.m @@ -253,6 +253,15 @@ contextMenuConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath return [UIContextMenuConfiguration configurationWithIdentifier:nil previewProvider:nil actionProvider:^UIMenu *(NSArray<UIMenuElement *> *suggestedActions) { + UIAction *deleteAction = [UIAction actionWithTitle:@"Delete" + image:[UIImage systemImageNamed:@"trash"] + identifier:nil + handler:^(__kindof UIAction * _Nonnull action) { + [self tableView:tableView + commitEditingStyle:UITableViewCellEditingStyleDelete + forRowAtIndexPath:indexPath]; + }]; + deleteAction.attributes = UIMenuElementAttributesDestructive; return [UIMenu menuWithTitle:nil children:@[ [UIAction actionWithTitle:@"Rename" image:[UIImage systemImageNamed:@"pencil"] @@ -267,6 +276,7 @@ contextMenuConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath [[GBROMManager sharedManager] duplicateROM:[GBROMManager sharedManager].allROMs[[indexPath indexAtPosition:1]]]; [self.tableView reloadData]; }], + deleteAction, ]]; }]; }

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.