Instance Method


Invoked to return an array of filenames that the receiver promises to create.


optional func collectionView(_ collectionView: NSCollectionView, namesOfPromisedFilesDroppedAtDestination dropURL: URL, forDraggedItemsAt indexes: IndexSet) -> [String]



The collection view that send the message.


The drop location where the files are created.


The indexes of the dragging items.

Return Value

An array of filenames (not full paths) for the created files that the receiver promises to create.


The delegate can support file promise drags by adding NSFilesPromisePboardType to the pasteboard in collectionView(_:writeItemsAt:to:).

For more information on file promise dragging, see documentation for the NSDraggingSource protocol and namesOfPromisedFilesDropped(atDestination:).

You do not need to implement this delegate method for your collection view to be a drag source.

See Also

Legacy Collection View Support

func collectionView(NSCollectionView, canDragItemsAt: IndexSet, with: NSEvent) -> Bool

Returns a Boolean indicating whether the collection view can begin dragging the specified items.

func collectionView(NSCollectionView, pasteboardWriterForItemAt: Int) -> NSPasteboardWriting?

Provides the pasteboard writer for the item at the specified index

func collectionView(NSCollectionView, writeItemsAt: IndexSet, to: NSPasteboard) -> Bool

Invoked after it has been determined that a drag should begin, but before the drag has been started.

func collectionView(NSCollectionView, acceptDrop: NSDraggingInfo, index: Int, dropOperation: NSCollectionView.DropOperation) -> Bool

Invoked when the mouse is released over a collection view that previously allowed a drop.