<!--
{
  "availability" : [
    "macOS: 10.8.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextField/preferredMaxLayoutWidth",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextField(py)preferredMaxLayoutWidth"
  },
  "title" : "preferredMaxLayoutWidth"
}
-->

# preferredMaxLayoutWidth

The maximum width of the text field’s intrinsic content size.

```
var preferredMaxLayoutWidth: CGFloat { get set }
```

## Discussion

If the text field wraps, the intrinsic height is large enough to show the entire text contents at that width.

The default value is `0`, indicating no maximum preferred width.

---

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)