Does anyone have an idea how to let the user open a folder in an app built with UIKit for Mac?
My use case is that I want the user to be able to specify a directory on the Mac, from where the app will import data into the app.
I don't seem to be able to use NSOpenPanel when building for UIKit for Mac. Is there a workaround??
Any help much appreciated.
Mac Users are used to Drag and Drop as a primary means of interaction, and as you've discovered the act of dropping the folder onto your app will give you app sandbox permission to read the folder and its contents.
If you want to provide an open dialog use UIDocumentPickerViewController. This picker will display like NSOpenPanel from AppKit, but is compatible with iPad and iPhone builds of your app too.
If you want to provide an open dialog use UIDocumentPickerViewController. This picker will display like NSOpenPanel from AppKit, but is compatible with iPad and iPhone builds of your app too.