---
title: "setDynamicDepthLimit(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindow/setdynamicdepthlimit(_:)"
---

# setDynamicDepthLimit(_:)

Sets a Boolean value that indicates whether the window’s depth limit can change to match the depth of the screen it’s on.

## Declaration

```swift
func setDynamicDepthLimit(_ flag: Bool)
```

## Parameters

- `flag`: doc://com.apple.documentation/documentation/Swift/true if the window’s depth can change; otherwise, doc://com.apple.documentation/documentation/Swift/false.

## 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)
- [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)
- [autorecalculatesContentBorderThickness(for:)](appkit/nswindow/autorecalculatescontentborderthickness(for:).md)
