The only workaround I have found is to ask the user for access to the whole folder. This, of course, is bad from a user privacy / security standpoint, especially as it gives the app access not only to the folder contents, but all subfolders. Can you give me a better workaround?
Unfortunately, no, not really. In terms of the first save/access, you could also present an additional open/save dialog for the specific related file, but that's basically just a more cumbersome alternative.
After that first access, you can use security-scoped bookmarks to preserve access to the "target" which can work well if it fits your app’s general usage "pattern". Xcode is an example of how this can work, with the project file holding the bookmarks for all of the other files it references.
One final note on this— unfortunately, there's a known bug (r.102995804) in iOS that prevents bookmarks from resolving properly across mount/unmount cycles. Bookmarks within the boot volume should work fine, but bookmarks on external volumes will break as soon as the volume is remounted.
or implement the API on iOS and Catalyst?
That's a reasonable request, but all I can really say is that this hasn't changed in iOS 27.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware