herzbube / littlego

Little Go. An iOS application that lets you play the game of Go on the iPhone or iPad.
https://littlego.herzbube.ch/
Apache License 2.0
138 stars 54 forks source link

Add file watcher to auto-refresh game list on Archive tab #391

Open herzbube opened 1 year ago

herzbube commented 1 year ago

When an .sgf file is uploaded into the app via iTunes, the file does not automatically show up in the list of games on the "Archive" tab. Several workarounds currently exist (e.g. lock/unlock the device), but they all involve sending the app to the background.

240 suggests adding a refresh button, but this still requires the user to take manual action to see the added file(s). A better approach would be to have a file watcher that automatically refreshes the list of games whenever it detects a change in the app's document folder.

This issue replaces #240.

herzbube commented 1 year ago

Initial research indicates that GCD (Grand Central Dispatch) can be used to receive notifications about filesystem changes.