<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextSelectionManager/Delegate-swift.protocol/selectionManager(_:makeDraggingSession:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextSelectionManagerDelegate(im)selectionManager:makeDraggingSessionWithGesture:"
  },
  "title" : "selectionManager(_:makeDraggingSession:)"
}
-->

# selectionManager(_:makeDraggingSession:)

Creates and returns a dragging session for the specified gesture recognizer.

```
optional func selectionManager(_ selectionManager: NSTextSelectionManager, makeDraggingSession gesture: NSGestureRecognizer) -> NSDraggingSession?
```

## Parameters

`selectionManager`

The selection manager requesting the dragging session.

`gesture`

The gesture recognizer that detected the drag attempt.

## Return Value

A new dragging session, or `nil` to prevent dragging.

## Discussion

The selection manager calls this method when the user attempts to drag the current text selection. Use this method to customize the dragging behavior, including setting drag data and drag images.

---

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)