---
title: layoutManager
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/nstextcontainer/layoutmanager
---

# layoutManager

The text container’s layout manager.

## Declaration

```swift
unowned(unsafe) var layoutManager: NSLayoutManager? { get set }
```

## Discussion

Discussion Avoid assigning a layout manager directly through this property. Instead, use the replaceLayoutManager(_:) method when you want to replace the layout manager. The framework sets the value of this property automatically when you add a text container to your layout manager using the addTextContainer(_:) method.

## See Also

### Related Documentation

- [addTextContainer(_:)](uikit/nslayoutmanager/addtextcontainer(_:).md)

### Managing text components

- [textLayoutManager](uikit/nstextcontainer/textlayoutmanager.md)
- [replaceLayoutManager(_:)](uikit/nstextcontainer/replacelayoutmanager(_:).md)
- [textView](appkit/nstextcontainer/textview.md)
