<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalKit",
  "identifier" : "/documentation/MetalKit/MTKView/sampleCount",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "MetalKit"
    ],
    "preciseIdentifier" : "c:objc(cs)MTKView(py)sampleCount"
  },
  "title" : "sampleCount"
}
-->

# sampleCount

The sample count used to generate the [`multisampleColorTexture`](/documentation/MetalKit/MTKView/multisampleColorTexture) object.

```
var sampleCount: Int { get set }
```

## Discussion

Support for different sample count values varies by device object. Call the <doc://com.apple.documentation/documentation/Metal/MTLDevice/supportsTextureSampleCount(_:)> method to determine if the device object supports the sample count you want.

The default value is `1`. When you set a value greater than `1`, the view creates and configures an intermediate set of multisample textures. The pixel format is the same as the one specified for the drawable; see [`colorPixelFormat`](/documentation/MetalKit/MTKView/colorPixelFormat). When the view creates a render pass descriptor, the render pass uses those intermediate textures as the color render targets, with a store action to resolve these multisample textures into the drawable’s texture (<doc://com.apple.documentation/documentation/Metal/MTLStoreAction/multisampleResolve>).

---

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)