I have a file (let's say a PDF) I have stored to disk on my macos Cocoa application. I have the NSURL that contains the path to this file.
I am currently showing that this file exists to the user using an NSView, which contains a label displaying the filename, and an NSImageView, displaying the file's icon (using NSWorkspace.shared.icon(forFile:url.path)).
My question is, how can I allow the user to 'select' or 'highlight' this NSView and when the space bar key is tapped have the QuickLook preview pop up for that particular file.
In addition, how would I have the NSView be draggable, with the end result of being able to drag the NSView to a Finder window and have the file copied to the dragged destination.
For both the QuickLook and dragging functionalities, I have gone through the Apple documentation but haven't found anything that accurately describes what I'm after.