---
title: NSTextElement
framework: uikit
role: symbol
role_heading: Class
path: uikit/nstextelement
---

# NSTextElement

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

## Declaration

```swift
class NSTextElement
```

## Topics

### Creating a text element

- [init(textContentManager:)](uikit/nstextelement/init(textcontentmanager:).md)

### Accessing the content manager

- [textContentManager](uikit/nstextelement/textcontentmanager.md)

### Accessing the text element range

- [elementRange](uikit/nstextelement/elementrange.md)

### Accessing text elements

- [isRepresentedElement](uikit/nstextelement/isrepresentedelement.md)
- [parent](uikit/nstextelement/parent.md)
- [childElements](uikit/nstextelement/childelements.md)

## Relationships

### Inherits From

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

### Inherited By

- [NSTextParagraph](uikit/nstextparagraph.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)

## See Also

### Content elements

- [Enriching your text in text views](uikit/enriching-your-text-in-text-views.md)
- [NSTextParagraph](uikit/nstextparagraph.md)
- [NSTextListElement](uikit/nstextlistelement.md)
- [NSTextElementProvider](uikit/nstextelementprovider.md)
