---
title: "setAutorecalculatesContentBorderThickness(_:for:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindow/setautorecalculatescontentborderthickness(_:for:)"
---

# setAutorecalculatesContentBorderThickness(_:for:)

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

## Declaration

```swift
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

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:.

## See Also

### Configuring the Window’s Appearance

- [styleMask](appkit/nswindow/stylemask-swift.property.md)
- [NSWindow.StyleMask](appkit/nswindow/stylemask-swift.struct.md)
- [toggleFullScreen(_:)](appkit/nswindow/togglefullscreen(_:).md)
- [worksWhenModal](appkit/nswindow/workswhenmodal.md)
- [alphaValue](appkit/nswindow/alphavalue.md)
- [backgroundColor](appkit/nswindow/backgroundcolor.md)
- [colorSpace](appkit/nswindow/colorspace.md)
- [setDynamicDepthLimit(_:)](appkit/nswindow/setdynamicdepthlimit(_:).md)
- [canHide](appkit/nswindow/canhide.md)
- [isOnActiveSpace](appkit/nswindow/isonactivespace.md)
- [hidesOnDeactivate](appkit/nswindow/hidesondeactivate.md)
- [collectionBehavior](appkit/nswindow/collectionbehavior-swift.property.md)
- [isOpaque](appkit/nswindow/isopaque.md)
- [hasShadow](appkit/nswindow/hasshadow.md)
- [invalidateShadow()](appkit/nswindow/invalidateshadow().md)
