---
title: "ensureLayout(for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nstextlayoutmanager/ensurelayout(for:)-3duae"
---

# ensureLayout(for:)

Performs the layout for specified text range.

## Declaration

```swift
func ensureLayout(for range: NSTextRange)
```

## Parameters

- `range`: The doc://com.apple.uikit/documentation/UIKit/NSTextRange that describes the content to lay out.

## See Also

### Causing layout generation

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