---
title: "glyph(at:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nslayoutmanager/glyph(at:)"
---

# glyph(at:)

Returns the glyph at the specified index.

## Declaration

```swift
func glyph(at glyphIndex: Int) -> CGGlyph
```

## Parameters

- `glyphIndex`: The index of a glyph in the receiver. This value must not exceed the bounds of the receiver’s glyph array.

## Return Value

Return Value The glyph at glyphIndex.

## Discussion

Discussion Raises an NSRangeException if glyphIndex is out of bounds. Performs glyph generation if needed. To avoid an exception with glyph(at:) you must first check the glyph index against the number of glyphs, which requires generating all glyphs. Another method, glyph(at:isValidIndex:), generates glyphs only up to the one requested, so using it can be more efficient.

## See Also

### Methods

- [showCGGlyphs(_:positions:count:font:matrix:attributes:in:)](uikit/nslayoutmanager/showcgglyphs(_:positions:count:font:matrix:attributes:in:).md)
- [invalidateGlyphs(onLayoutInvalidationForGlyphRange:)](appkit/nslayoutmanager/invalidateglyphs(onlayoutinvalidationforglyphrange:).md)
- [invalidateLayout(forCharacterRange:isSoft:actualCharacterRange:)](appkit/nslayoutmanager/invalidatelayout(forcharacterrange:issoft:actualcharacterrange:).md)
- [textStorage(_:edited:range:changeInLength:invalidatedRange:)](appkit/nslayoutmanager/textstorage(_:edited:range:changeinlength:invalidatedrange:).md)
- [insertGlyph(_:atGlyphIndex:characterIndex:)](appkit/nslayoutmanager/insertglyph(_:atglyphindex:characterindex:).md)
- [insertGlyphs(_:length:forStartingGlyphAt:characterIndex:)](appkit/nslayoutmanager/insertglyphs(_:length:forstartingglyphat:characterindex:).md)
- [glyph(at:isValidIndex:)](uikit/nslayoutmanager/glyph(at:isvalidindex:).md)
- [replaceGlyph(at:withGlyph:)](appkit/nslayoutmanager/replaceglyph(at:withglyph:).md)
- [getGlyphs(_:range:)](appkit/nslayoutmanager/getglyphs(_:range:).md)
- [getGlyphs(in:glyphs:characterIndexes:glyphInscriptions:elasticBits:)](appkit/nslayoutmanager/getglyphs(in:glyphs:characterindexes:glyphinscriptions:elasticbits:).md)
- [getGlyphs(in:glyphs:characterIndexes:glyphInscriptions:elasticBits:bidiLevels:)](appkit/nslayoutmanager/getglyphs(in:glyphs:characterindexes:glyphinscriptions:elasticbits:bidilevels:).md)
- [deleteGlyphs(in:)](appkit/nslayoutmanager/deleteglyphs(in:).md)
- [setCharacterIndex(_:forGlyphAt:)](appkit/nslayoutmanager/setcharacterindex(_:forglyphat:).md)
- [intAttribute(_:forGlyphAt:)](appkit/nslayoutmanager/intattribute(_:forglyphat:).md)
- [setIntAttribute(_:value:forGlyphAt:)](appkit/nslayoutmanager/setintattribute(_:value:forglyphat:).md)
