Instance Method

collectionView(_:namesOfPromisedFilesDroppedAtDestination:forDraggedItemsAt:)

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

Declaration

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

Parameters

collectionView

The collection view that send the message.

dropURL

The drop location where the files are created.

indexes

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.

Discussion

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.

Deprecated
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.