---
title: "collectionView(_:draggingSession:endedAt:dragOperation:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscollectionviewdelegate/collectionview(_:draggingsession:endedat:dragoperation:)"
---

# collectionView(_:draggingSession:endedAt:dragOperation:)

Notifies your delegate that a drag session ended.

## Declaration

```swift
@MainActor optional func collectionView(_ collectionView: NSCollectionView, draggingSession session: NSDraggingSession, endedAt screenPoint: NSPoint, dragOperation operation: NSDragOperation)
```

## Parameters

- `collectionView`: The collection view notifying your delegate object.
- `session`: The dragging session that ended.
- `screenPoint`: The end point (in screen coordinates) for the drag operation.
- `operation`: The operation that was performed. Use this value to determine how the operation ended. For example, for content that was dragged to the trash, the operation type would be doc://com.apple.appkit/documentation/AppKit/NSDragOperation/delete.

## Discussion

Discussion You can use this method to perform tasks related to the ending of a drag session.

## See Also

### Drag and Drop Support

- [Supporting Collection View Drag and Drop Through File Promises](appkit/supporting-collection-view-drag-and-drop-through-file-promises.md)
- [collectionView(_:canDragItemsAt:with:)](appkit/nscollectionviewdelegate/collectionview(_:candragitemsat:with:)-49wix.md)
- [collectionView(_:pasteboardWriterForItemAt:)](appkit/nscollectionviewdelegate/collectionview(_:pasteboardwriterforitemat:)-5eyyl.md)
- [collectionView(_:writeItemsAt:to:)](appkit/nscollectionviewdelegate/collectionview(_:writeitemsat:to:)-23ozm.md)
- [collectionView(_:namesOfPromisedFilesDroppedAtDestination:forDraggedItemsAt:)](appkit/nscollectionviewdelegate/collectionview(_:namesofpromisedfilesdroppedatdestination:fordraggeditemsat:)-6yag4.md)
- [collectionView(_:draggingImageForItemsAt:with:offset:)](appkit/nscollectionviewdelegate/collectionview(_:draggingimageforitemsat:with:offset:)-898js.md)
- [collectionView(_:draggingSession:willBeginAt:forItemsAt:)](appkit/nscollectionviewdelegate/collectionview(_:draggingsession:willbeginat:foritemsat:)-68x2y.md)
- [collectionView(_:updateDraggingItemsForDrag:)](appkit/nscollectionviewdelegate/collectionview(_:updatedraggingitemsfordrag:).md)
- [collectionView(_:validateDrop:proposedIndexPath:dropOperation:)](appkit/nscollectionviewdelegate/collectionview(_:validatedrop:proposedindexpath:dropoperation:).md)
- [collectionView(_:acceptDrop:indexPath:dropOperation:)](appkit/nscollectionviewdelegate/collectionview(_:acceptdrop:indexpath:dropoperation:).md)
