Instance Method

usedRectForTextContainer:

Returns the bounding rectangle for the glyphs in the specified text container.

Declaration

iOS, Mac Catalyst, tvOS
- (CGRect)usedRectForTextContainer:(NSTextContainer *)container;
macOS
- (NSRect)usedRectForTextContainer:(NSTextContainer *)container;

Discussion

Returns the text container's currently used area, which determines the size that the view would need to be in order to display all the glyphs that are currently laid out in the container. This causes neither glyph generation nor layout.

Used rectangles are always in container coordinates.

See Also

Managing the Text Containers

textContainers

The current text containers of the layout manager.

- addTextContainer:

Appends the given text container to the series of text containers where the layout manager arranges text.

- insertTextContainer:atIndex:

Inserts a text container at the specified index in the list of text containers.

- removeTextContainerAtIndex:

Removes the text container at the specified index and invalidates the layout as needed.

- setTextContainer:forGlyphRange:

Associates a text container with the specified range of glyphs.

- textContainerChangedGeometry:

Invalidates the layout information, and possibly glyphs, for the specified text container and all subsequent text container objects.

- textContainerChangedTextView:

Updates the information needed to manage text view objects associated with the specified text container.

- textContainerForGlyphAtIndex:effectiveRange:

Returns the text container that manages the layout for the specified glyph, causing layout to happen as needed.

- textContainerForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:

Returns the text container that manages the layout for the specified glyph.