---
title: "textViewportLayoutController(_:configureRenderingSurfaceFor:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nstextviewportlayoutcontrollerdelegate/textviewportlayoutcontroller(_:configurerenderingsurfacefor:)"
---

# textViewportLayoutController(_:configureRenderingSurfaceFor:)

The method the framework calls when the layout controller lays out a text layout fragment in the UI.

## Declaration

```swift
func textViewportLayoutController(_ textViewportLayoutController: NSTextViewportLayoutController, configureRenderingSurfaceFor textLayoutFragment: NSTextLayoutFragment)
```

## Parameters

- `textViewportLayoutController`: The NSTextViewportLayoutController associated with this text layout fragment.
- `textLayoutFragment`: An NSTextLayoutFragment.

## Discussion

Discussion The delegate presents the text layout fragment in the UI, for example, in a sublayer or a subview. Layout information such as viewportBounds on textViewportLayoutController isn’t up to date at the point of this call.

## See Also

### Responding to changes in the viewport

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