<!--
{
  "availability" : [
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextAttachmentViewProvider/init(textAttachment:parentView:textLayoutManager:location:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextAttachmentViewProvider(im)initWithTextAttachment:parentView:textLayoutManager:location:"
  },
  "title" : "init(textAttachment:parentView:textLayoutManager:location:)"
}
-->

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

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

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

## Parameters

`textAttachment`

The [`NSTextAttachment`](/documentation/AppKit/NSTextAttachment) for this view.

`parentView`

The parent view of this attachment.

`textLayoutManager`

The [`NSTextLayoutManager`](/documentation/AppKit/NSTextLayoutManager) for this view.

`location`

The [`NSTextLocation`](/documentation/AppKit/NSTextLocation) that identifies the start of the text.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)