Contents

shouldBreakLine(byWordBeforeCharacterAt:)

Returns whether the line being laid out should be broken by a word break at the specified character.

Declaration

func shouldBreakLine(byWordBeforeCharacterAt charIndex: Int) -> Bool

Parameters

  • charIndex:

    The index of the character just after the proposed word break would occur.

Return Value

true if the line should be broken by a word break, false otherwise.

Discussion

The typesetter calls this method, if implemented by a subclass, before breaking a line by word wrapping before the character at charIndex, enabling the subclass to control line breaking.

A subclass can override this method to customize the text layout process. If the method returns false, the typesetter continues looking for a break point.

See Also

Laying out glyphs