<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSATSTypesetter/shouldBreakLine(byHyphenatingBeforeCharacterAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSATSTypesetter(im)shouldBreakLineByHyphenatingBeforeCharacterAtIndex:"
  },
  "title" : "shouldBreakLine(byHyphenatingBeforeCharacterAt:)"
}
-->

# shouldBreakLine(byHyphenatingBeforeCharacterAt:)

Breaks a line by hyphenating before the character at the specified index.

```
func shouldBreakLine(byHyphenatingBeforeCharacterAt charIndex: Int) -> Bool
```

## Discussion

The typesetter calls this method, if implemented by a subclass, before breaking a line by hyphenating before the character at the given character index, enabling the subclass to control line breaking. A subclass can override this method to customize the text layout process. If the method returns <doc://com.apple.documentation/documentation/Swift/false>, the typesetter continues looking for a break point.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)