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
collectionView(_:canDragItemsAt:with:)collectionView(_:pasteboardWriterForItemAt:)collectionView(_:writeItemsAt:to:)collectionView(_:draggingImageForItemsAt:with:offset:)collectionView(_:draggingSession:willBeginAt:forItemsAt:)collectionView(_:validateDrop:proposedIndex:dropOperation:)collectionView(_:acceptDrop:index:dropOperation:)