---
title: textSelection
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nstextselectionmanager/delegate-swift.protocol/textselection
---

# textSelection

The current text selection.

## Declaration

```swift
var textSelection: NSTextSelection? { get set }
```

## Discussion

Discussion The text selection manager updates this property in response to user interactions. The delegate is responsible for storing and providing access to the current selection. The NSTextLocation values that make up the NSTextRange objects can be any object that can describe a location in your text.
