---
title: "init(textAttachment:parentView:textLayoutManager:location:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nstextattachmentviewprovider/init(textattachment:parentview:textlayoutmanager:location:)"
---

# init(textAttachment:parentView:textLayoutManager:location:)

Creates a new text attachment view whose content starts at the location you provide.

## Declaration

```swift
init(textAttachment: NSTextAttachment, parentView: NSView?, textLayoutManager: NSTextLayoutManager?, location: any NSTextLocation)
```

## Parameters

- `textAttachment`: The doc://com.apple.appkit/documentation/AppKit/NSTextAttachment for this view.
- `parentView`: The parent view of this attachment.
- `textLayoutManager`: The doc://com.apple.appkit/documentation/AppKit/NSTextLayoutManager for this view.
- `location`: The doc://com.apple.appkit/documentation/AppKit/NSTextLocation that identifies the start of the text.
