---
title: "textContentManager(_:textElementAt:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextcontentmanagerdelegate/textcontentmanager(_:textelementat:)"
---

# textContentManager(_:textElementAt:)

The method the framework calls to return the text element at a specific location.

## Declaration

```swift
optional func textContentManager(_ textContentManager: NSTextContentManager, textElementAt location: any NSTextLocation) -> NSTextElement?
```

## Parameters

- `textContentManager`: The content manager.
- `location`: The location of the element.

## Return Value

Return Value An NSTextElement.

## Discussion

Discussion When non-nil, textContentManager uses the text element you specify instead of creating one based on its standard mapping logic.
