lmmenge / MeSNEmu

Super Nintendo Entertainment System (SNES) / Super Famicom emulator (based on SNES9X) for iOS (iPhone/iPad)
223 stars 75 forks source link

Added force touch support in order to access 4 recently played roms #25

Open ghost opened 8 years ago

ghost commented 8 years ago

I modified LMAppDelegate.m and LMROMBrowserController.m.

In LMROMBrowserController.m - every time the delegate method "didSelectRomAtIndexPath" is called I just pushed the Rom name into NSUserdefaults in order to save that it was last played. Also, If the rom gets deleted, NSUserdefaults gets updated accordingly. The string array in NSUserdefaults never grows beyond 4 strings (rom names) because of the implementation in order to comply with the fact that force touch shortcuts are limited to 4 options only.

In LMAppDelegate I added supported for force touch on devices that have it available. If the devices do not have force touch, it is handled gracefully by launching the app normally.

Future Update: Will be working on adding downloading roms from safari.

Youtube: https://youtu.be/hd8EUgp5Mok