<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWindow/setAutorecalculatesContentBorderThickness(_:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWindow(im)setAutorecalculatesContentBorderThickness:forEdge:"
  },
  "title" : "setAutorecalculatesContentBorderThickness(_:for:)"
}
-->

# setAutorecalculatesContentBorderThickness(_:for:)

Specifies whether the window calculates the thickness of a given border automatically.

```
func setAutorecalculatesContentBorderThickness(_ flag: Bool, for edge: NSRectEdge)
```

## Parameters

`flag`

If <doc://com.apple.documentation/documentation/Swift/true>, the window calculates the thickness of the edge automatically; if <doc://com.apple.documentation/documentation/Swift/false>, it does not.

`edge`

The border to set auto-recalculation on or off:

- `NSMaxYEdge`: Top border.
- `NSMinYEdge`: Bottom border.

## Discussion

Turning off a border’s auto-recalculation status sets its border thickness to `0.0`.

In a nontextured window calling `setAutorecalculatesContentBorderThickness:forEdge:` passing `NSMaxYEdge` will raise an exception (in a nontextured window, it’s only valid to set the content border thickness of the bottom edge). It is only valid to set the content border thickness of the top edge in a textured window.

Typically, if you call `setContentBorderThickness:forEdge:`, you should also call `setAutorecalculatesContentBorderThickness:NO forEdge:`.

---

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)