I have tried about every document type and delegate method by now, and my non-document-based app just doesn't accept any dropped file/folder on the dock icon.
This is the document type I copied from Apples Notes app which supports dropping folders on its icon:
<dict>
<key>CFBundleTypeName</key>
<string>General files and folders</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>public.folder</string>
</array>
</dict>
The delegate is set correctly, otherwise my applicationWillFinishLaunching would not be called at all.
I tried to implement any of
application(_ sender: NSApplication, openFile filename: String) -> Boolapplication(_ sender: NSApplication, openFiles filenames: [String])
with no success. I just cannot get the dock icon to accept a drop. What am I missing?
UPDATE:
Turns out I have to drag the Debug build to /Applications in order for a drag to be accepted. This is more than cumbersome, to say the least. Any way around this?