Instance Method

layoutManager(_:boundingBoxForControlGlyphAt:for:proposedLineFragment:glyphPosition:characterIndex:)

Returns the bounding rectangle for the specified control glyph with the specified parameters.

Declaration

iOS, Mac Catalyst, tvOS
optional func layoutManager(_ layoutManager: NSLayoutManager, boundingBoxForControlGlyphAt glyphIndex: Int, for textContainer: NSTextContainer, proposedLineFragment proposedRect: CGRect, glyphPosition: CGPoint, characterIndex charIndex: Int) -> CGRect
macOS
optional func layoutManager(_ layoutManager: NSLayoutManager, boundingBoxForControlGlyphAt glyphIndex: Int, for textContainer: NSTextContainer, proposedLineFragment proposedRect: NSRect, glyphPosition: NSPoint, characterIndex charIndex: Int) -> NSRect

Parameters

layoutManager

The layout manager doing the layout.

glyphIndex

The index of the control glyph in question.

textContainer

The text container to use to calculate the position.

proposedRect

The proposed line fragment rectangle.

glyphPosition

The position of the glyph in textContainer.

charIndex

The character index in textContainer.

Return Value

The bounding rectangle for the specified control glyph with the specified parameters.

Discussion

Sent for resolving the glyph metrics for NSControlCharacterWhitespaceAction control character.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software