---
title: bitsPerSample
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nswindow/depth/bitspersample
---

# bitsPerSample

Returns the bits per sample for the specified window depth.

## Declaration

```swift
var bitsPerSample: Int { get }
```

## Discussion

Discussion Returns the number of bits per sample (bits per pixel in each color component) for the window depth specified by depth.

## See Also

### Working with Window Depths

- [bitsPerPixel](appkit/nswindow/depth/bitsperpixel.md)
- [colorSpaceName](appkit/nswindow/depth/colorspacename.md)
- [numberOfColorComponents](appkit/nscolorspacename/numberofcolorcomponents.md)
- [isPlanar](appkit/nswindow/depth/isplanar.md)
- [canRepresent(_:)](appkit/nswindow/canrepresent(_:).md)
