<!--
{
  "availability" : [
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextLayoutManagerDelegate/textLayoutManager(_:shouldBreakLineBefore:hyphenating:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextLayoutManagerDelegate(im)textLayoutManager:shouldBreakLineBeforeLocation:hyphenating:"
  },
  "title" : "textLayoutManager(_:shouldBreakLineBefore:hyphenating:)"
}
-->

# textLayoutManager(_:shouldBreakLineBefore:hyphenating:)

Invoked while determining the soft line break point.

```
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`](/documentation/AppKit/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.

---

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)