This worked for me (in a subclass of NSWindow):
In awakeFromNib:
registerForDraggedTypes([NSFilenamesPboardType])
Then add the following operations (at least draggingEntered and performDragOperation) to the window (or view):
func draggingEntered(sender: NSDraggingInfo) -> NSDragOperation { let sourceDragMask = sender.draggingSourceOperationMask() let pboard = sender.draggingPasteboard()! if pboard.availableTypeFromArray([NSFilenamesPboardType]) == NSFilenamesPboardType { if sourceDragMask.rawValue & NSDragOperation.Generic.rawValue != 0 { return NSDragOperation.Generic } } return NSDragOperation.None } func draggingUpdated(sender: NSDraggingInfo) -> NSDragOperation { return NSDragOperation.Generic } func prepareForDragOperation(sender: NSDraggingInfo) -> Bool { return true } func performDragOperation(sender: NSDraggingInfo) -> Bool {
Ienne source share