<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSLayoutManager/addTextContainer(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSLayoutManager(im)addTextContainer:"
  },
  "title" : "addTextContainer(_:)"
}
-->

# addTextContainer(_:)

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

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

## Parameters

`container`

The text container to append.

## Discussion

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

---

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)