<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSLayoutManager/attachmentSize(forGlyphAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSLayoutManager(im)attachmentSizeForGlyphAtIndex:"
  },
  "title" : "attachmentSize(forGlyphAt:)"
}
-->

# attachmentSize(forGlyphAt:)

Returns the size of the attachment glyph at the specified index.

```
func attachmentSize(forGlyphAt glyphIndex: Int) -> CGSize
```

## Parameters

`glyphIndex`

The index of the attachment glyph.

## Return Value

The layout manager calls this method for glyphs representing attachments, and returns the size that the attachment cell occupies. Returns `{-1.0, -1.0}` if there is no attachment laid for the specified glyph.

## See Also

[`func setAttachmentSize(CGSize, forGlyphRange: NSRange)`](/documentation/UIKit/NSLayoutManager/setAttachmentSize(_:forGlyphRange:))

Sets the size to use when drawing a glyph that represents an attachment.

  <doc://com.apple.documentation/documentation/AppKit/NSLayoutManager/defaultAttachmentScaling>



---

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)