---
title: "textViewportLayoutController(_:cacheRenderingSurface:for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nstextviewportlayoutcontrollerdelegate/textviewportlayoutcontroller(_:cacherenderingsurface:for:)"
---

# textViewportLayoutController(_:cacheRenderingSurface:for:)

## Declaration

```swift
optional func textViewportLayoutController(_ textViewportLayoutController: NSTextViewportLayoutController, cacheRenderingSurface renderingSurface: any NSTextViewportRenderingSurface, for renderingSurfaceKey: any NSTextViewportRenderingSurfaceKey)
```

## See Also

### Storing rendering surfaces

- [textViewportLayoutController(_:retrieveCachedRenderingSurfaceFor:)](uikit/nstextviewportlayoutcontrollerdelegate/textviewportlayoutcontroller(_:retrievecachedrenderingsurfacefor:).md)
