---
title: NSTextSelectionManager
framework: appkit
role: symbol
role_heading: Class
path: appkit/nstextselectionmanager
---

# NSTextSelectionManager

An object that coordinates text selection behavior for custom text views.

## Declaration

```swift
@MainActor class NSTextSelectionManager
```

## Overview

Overview NSTextSelectionManager provides a centralized way to manage text selection interactions using a set of gesture recognizers. For keyboard-based selection, integrate NSTextSelectionNavigation with your view. The selection manager works with a delegate to update and respond to selection changes, and with a data source to query the text layout system.

## Topics

### Protocols

- [NSTextSelectionManager.Delegate](appkit/nstextselectionmanager/delegate-swift.protocol.md)

### Instance Properties

- [delegate](appkit/nstextselectionmanager/delegate-swift.property.md)
- [gesturesForFailureRequirements](appkit/nstextselectionmanager/gesturesforfailurerequirements.md)
- [textSelectionDataSource](appkit/nstextselectionmanager/textselectiondatasource.md)
- [textSelectionMode](appkit/nstextselectionmanager/textselectionmode.md)

### Enumerations

- [NSTextSelectionManager.Mode](appkit/nstextselectionmanager/mode.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
