Contents

textLayoutManager(_:shouldBreakLineBefore:hyphenating:)

Invoked while determining the soft line break point.

Declaration

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

Parameters

  • textLayoutManager:

    The text layout manager sending the message.

  • location:

    The candidate break location.

  • hyphenating:

    true if this is an auto-hyphenation point.

Return Value

true to allow the break; false to prevent it.

Discussion

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

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

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