<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSTextElement",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextElement"
  },
  "title" : "NSTextElement"
}
-->

# NSTextElement

An abstract base class that represents the smallest units of text layout such as paragraphs or attachments.

```
class NSTextElement
```

## Topics

### Creating a text element

[`init(textContentManager:)`](/documentation/UIKit/NSTextElement/init(textContentManager:))

Creates a new text element with the content manager you provide.

### Accessing the content manager

[`textContentManager`](/documentation/UIKit/NSTextElement/textContentManager)

The value that represents the current content manager.

### Accessing the text element range

[`elementRange`](/documentation/UIKit/NSTextElement/elementRange)

A range value that represents the range of the element inside the document.

### Accessing text elements

[`isRepresentedElement`](/documentation/UIKit/NSTextElement/isRepresentedElement)

A Boolean value that indicates whether this element is in the text layout.

[`parent`](/documentation/UIKit/NSTextElement/parent)

A value that represents the parent element if this text element is a child of an enclosing element.

[`childElements`](/documentation/UIKit/NSTextElement/childElements)

An array of zero or more child text elements.



---

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)