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

# depthLimit

The depth limit of the window.

```
var depthLimit: NSWindow.Depth { get set }
```

## Discussion

The value of this property can be examined with the Application Kit functions [`isPlanar`](/documentation/AppKit/NSWindow/Depth/isPlanar), [`colorSpaceName`](/documentation/AppKit/NSWindow/Depth/colorSpaceName), [`bitsPerSample`](/documentation/AppKit/NSWindow/Depth/bitsPerSample), and [`bitsPerPixel`](/documentation/AppKit/NSWindow/Depth/bitsPerPixel). In addition, the [`NSBestDepth`](/documentation/AppKit/NSBestDepth) function provides the best depth limit based on a set of parameters.

Setting this property to `0` sets the depth limit to the window’s default depth limit. A depth limit of `0` can be useful for reverting a window object to its initial depth. You can also use one of the explicit bit depths defined in `Explicit Window Depth Limits` ([`NSWindow.Depth.twentyfourBitRGB`](/documentation/AppKit/NSWindow/Depth/twentyfourBitRGB) is the default).

---

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)