Contents

textLayoutManager(_:shouldBreakLineBefore:hyphenating:)

The method the framework calls to determine the soft line break point.

Declaration

optional func textLayoutManager(_ textLayoutManager: NSTextLayoutManager, shouldBreakLineBefore location: any NSTextLocation, hyphenating: Bool) -> Bool

Parameters

  • textLayoutManager:

    The text layout manager.

  • location:

    The location of the proposed line break.

  • hyphenating:

    A Boolean value that indicates the current hyphenation mode.

Return Value

A Boolean value that indicates if the framework should break the line at the current location.

Discussion

When hyphenating is false, NSTextLayoutManager tries to find the next line break opportunity before location. When hyphenating is true, it’s an auto-hyphenation point.

See Also

Responding to layout changes