---
title: "addTextContainer(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nslayoutmanager/addtextcontainer(_:)"
---

# addTextContainer(_:)

Appends the specified text container to the series of text containers where the layout manager arranges text.

## Declaration

```swift
func addTextContainer(_ container: NSTextContainer)
```

## Parameters

- `container`: The text container to append.

## Discussion

Discussion Invalidates glyphs and layout as needed, but doesn’t perform glyph generation or layout.

## See Also

### Managing the text containers

- [textContainers](uikit/nslayoutmanager/textcontainers.md)
- [insertTextContainer(_:at:)](uikit/nslayoutmanager/inserttextcontainer(_:at:).md)
- [removeTextContainer(at:)](uikit/nslayoutmanager/removetextcontainer(at:).md)
- [setTextContainer(_:forGlyphRange:)](uikit/nslayoutmanager/settextcontainer(_:forglyphrange:).md)
- [textContainerChangedGeometry(_:)](uikit/nslayoutmanager/textcontainerchangedgeometry(_:).md)
- [textContainerChangedTextView(_:)](appkit/nslayoutmanager/textcontainerchangedtextview(_:).md)
- [textContainer(forGlyphAt:effectiveRange:)](uikit/nslayoutmanager/textcontainer(forglyphat:effectiverange:).md)
- [textContainer(forGlyphAt:effectiveRange:withoutAdditionalLayout:)](uikit/nslayoutmanager/textcontainer(forglyphat:effectiverange:withoutadditionallayout:).md)
- [usedRect(for:)](uikit/nslayoutmanager/usedrect(for:).md)
