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

# collectionView(_:namesOfPromisedFilesDroppedAtDestination:forDraggedItemsAt:)

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]
```

## 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:)`](/documentation/AppKit/NSCollectionViewDelegate/collectionView(_:writeItemsAt:to:)-a1lk).

For more information on file promise dragging, see documentation for the NSDraggingSource protocol and [`namesOfPromisedFilesDropped(atDestination:)`](/documentation/AppKit/NSDraggingInfo/namesOfPromisedFilesDropped(atDestination:)).

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

---

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)