---
title: "textLayoutManager(_:cacheTextAttachmentViewProvider:for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nstextlayoutmanagerdelegate/textlayoutmanager(_:cachetextattachmentviewprovider:for:)"
---

# textLayoutManager(_:cacheTextAttachmentViewProvider:for:)

## Declaration

```swift
optional func textLayoutManager(_ textLayoutManager: NSTextLayoutManager, cacheTextAttachmentViewProvider viewProvider: NSTextAttachmentViewProvider, for textAttachment: NSTextAttachment)
```

## See Also

### Reusing text attachment view providers

- [textLayoutManager(_:retrieveCachedTextAttachmentViewProviderFor:)](uikit/nstextlayoutmanagerdelegate/textlayoutmanager(_:retrievecachedtextattachmentviewproviderfor:).md)
