<!--
{
  "availability" : [
    "macOS: 10.11.0 - 10.13.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionViewDelegate/collectionView(_:namesOfPromisedFilesDroppedAtDestination:forDraggedItemsAt:)-6yag4",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSCollectionViewDelegate(im)collectionView:namesOfPromisedFilesDroppedAtDestination:forDraggedItemsAtIndexPaths:"
  },
  "title" : "collectionView(_:namesOfPromisedFilesDroppedAtDestination:forDraggedItemsAt:)"
}
-->

# collectionView(_:namesOfPromisedFilesDroppedAtDestination:forDraggedItemsAt:)

Returns the names of the promised files that you created for a drag operation.

```
optional func collectionView(_ collectionView: NSCollectionView, namesOfPromisedFilesDroppedAtDestination dropURL: URL, forDraggedItemsAt indexPaths: Set<IndexPath>) -> [String]
```

## Parameters

`collectionView`

The collection view asking you to provide the list of filenames.

`dropURL`

The URL at which to create the promised files.

`indexPaths`

The index paths of the dragged items.

## Return Value

An array of strings containing the filenames you created, or intend to create, at the specified URL.

## Discussion

At the start of a drag operation, your app must provide the data that constitutes the items being dragged. If you specify a file promise, instead of the data itself, use this method to specify the names of the files you promised. If the files already exist, move them to the directory specified by the `dropURL` parameter. If you must create the files first, use this method to specify the names of the files you intend to provide and begin creating those files asynchronously on a background thread.

The filenames you return are made available from the [`namesOfPromisedFilesDropped(atDestination:)`](/documentation/AppKit/NSDraggingInfo/namesOfPromisedFilesDropped(atDestination:)) method of the [`NSDraggingInfo`](/documentation/AppKit/NSDraggingInfo) object passed around during the drag operation.

For more information about how to use file promises when dragging content, see [Drag and Drop Programming Topics](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/DragandDrop/DragandDrop.html#//apple_ref/doc/uid/10000069i).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)