Instance Method


Sets the bounds and container for the extra line fragment.


iOS, Mac Catalyst, tvOS
func setExtraLineFragmentRect(_ fragmentRect: CGRect, usedRect: CGRect, textContainer container: NSTextContainer)
func setExtraLineFragmentRect(_ fragmentRect: NSRect, usedRect: NSRect, textContainer container: NSTextContainer)



The rectangle to set.


Indicates where the insertion point is drawn.


The text container where the rectangle is to be laid out.


The extra line fragment is used when the text backing ends with a hard line break or when the text backing is totally empty, to define the extra line which needs to be displayed at the end of the text. If the text backing is not empty and does not end with a hard line break, this should be set to NSZeroRect and nil.

Line fragment rectangles and line fragment used rectangles are always in container coordinates.

This method is used by the layout mechanism and should be invoked only during typesetting, in almost all cases only by the typesetter. For example, a custom typesetter might invoke it.

See Also

Setting Layout Information

func setAttachmentSize(CGSize, forGlyphRange: NSRange)

Sets the size at which the given glyph (assumed to be an attachment) is asked to draw in the given glyph range.

func setDrawsOutsideLineFragment(Bool, forGlyphAt: Int)

Specifies whether the given glyph exceeds the bounds of the line fragment where it’s laid out.

func setLineFragmentRect(CGRect, forGlyphRange: NSRange, usedRect: CGRect)

Associates the given line fragment bounds with the given range of glyphs.

func setLocation(CGPoint, forStartOfGlyphRange: NSRange)

Sets the location for the first glyph of the given range.

func setNotShownAttribute(Bool, forGlyphAt: Int)

Sets the glyph at the given index to be one that isn’t shown.