---
title: "textViewportLayoutControllerWillLayout(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitextview/textviewportlayoutcontrollerwilllayout(_:)"
---

# textViewportLayoutControllerWillLayout(_:)

NSTextViewportLayoutControllerDelegate method that the framework calls when the text viewport layout controller starts its layout process. Requires a call to super.

## Declaration

```swift
func textViewportLayoutControllerWillLayout(_ textViewportLayoutController: NSTextViewportLayoutController)
```

## Mentioned in

Managing viewport layout and attachment reuse in text views

## See Also

### Customizing viewport layout

- [viewportBounds(for:)](uikit/uitextview/viewportbounds(for:).md)
- [textViewportLayoutControllerDidLayout(_:)](uikit/uitextview/textviewportlayoutcontrollerdidlayout(_:).md)
- [textViewportLayoutControllerReceivedSetNeedsLayout(_:)](uikit/uitextview/textviewportlayoutcontrollerreceivedsetneedslayout(_:).md)
