---
title: NSTextAttachmentLayout
framework: appkit
role: symbol
role_heading: Protocol
path: appkit/nstextattachmentlayout
---

# NSTextAttachmentLayout

A set of methods that defines the interface to attachment objects from a text layout manager.

## Declaration

```swift
protocol NSTextAttachmentLayout : NSObjectProtocol
```

## Overview

Overview The NSTextAttachmentLayout protocol is the interface for working with attachment objects with an NSTextAttachmentViewProvider using a NSTextLayoutManager in macOS 12 and iOS 15 and later.

## Topics

### Determining the characteristics of an attachment

- [attachmentBounds(for:location:textContainer:proposedLineFragment:position:)](appkit/nstextattachmentlayout/attachmentbounds(for:location:textcontainer:proposedlinefragment:position:).md)
- [image(for:attributes:location:textContainer:)](appkit/nstextattachmentlayout/image(for:attributes:location:textcontainer:).md)
- [viewProvider(for:location:textContainer:)](appkit/nstextattachmentlayout/viewprovider(for:location:textcontainer:).md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

### Conforming Types

- [NSTextAttachment](appkit/nstextattachment.md)

## See Also

### Attachments

- [NSTextAttachment](appkit/nstextattachment.md)
- [NSTextAttachmentViewProvider](appkit/nstextattachmentviewprovider.md)
- [NSAdaptiveImageGlyph](appkit/nsadaptiveimageglyph.md)
- [NSTextAttachmentContainer](appkit/nstextattachmentcontainer.md)
- [NSTextAttachmentCell](appkit/nstextattachmentcell-swift.class.md)
- [NSTextAttachmentCellProtocol](appkit/nstextattachmentcellprotocol.md)
