---
title: "ensureLayout(for:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextlayoutmanager/ensurelayout(for:)-6ptsj"
---

# ensureLayout(for:)

Performs the layout for filling the bounds you specify inside the last text container.

## Declaration

```swift
func ensureLayout(for bounds: CGRect)
```

## Parameters

- `bounds`: A doc://com.apple.documentation/documentation/CoreFoundation/CGRect that describes the layout bounds.

## See Also

### Causing layout generation

- [textViewportLayoutController](appkit/nstextlayoutmanager/textviewportlayoutcontroller.md)
- [invalidateLayout(for:)](appkit/nstextlayoutmanager/invalidatelayout(for:).md)
- [textLayoutFragment(for:)](appkit/nstextlayoutmanager/textlayoutfragment(for:)-68dez.md)
- [textLayoutFragment(for:)](appkit/nstextlayoutmanager/textlayoutfragment(for:)-4dhrx.md)
- [ensureLayout(for:)](appkit/nstextlayoutmanager/ensurelayout(for:)-3duae.md)
- [enumerateTextLayoutFragments(from:options:using:)](appkit/nstextlayoutmanager/enumeratetextlayoutfragments(from:options:using:).md)
- [NSTextLayoutManager.SegmentType](appkit/nstextlayoutmanager/segmenttype.md)
- [NSTextLayoutManager.SegmentOptions](appkit/nstextlayoutmanager/segmentoptions.md)
