---
title: currentDrawable
framework: metalkit
role: symbol
role_heading: Instance Property
path: metalkit/mtkview/currentdrawable
---

# currentDrawable

The drawable to use for the current frame.

## Declaration

```swift
var currentDrawable: (any CAMetalDrawable)? { get }
```

## Discussion

Discussion If all drawable objects are in use, the value of this property is nil. Your app should check that currentDrawable isn’t nil before attempting to draw. The view changes the value of this property only after returning from a drawing function, either draw(_:) from a subclassed instance of the view, or draw(in:) from the view’s delegate. Use a MTLRenderCommandEncoder object to render into the drawable’s texture and present it for display (typically registered using the present(_:) method of a command buffer). Try to minimize the time between when you fetch the drawable and when you submit the command buffer that uses it. For more information, see CAMetalLayer.

## See Also

### Retrieving Render Target Information

- [currentRenderPassDescriptor](metalkit/mtkview/currentrenderpassdescriptor.md)
- [depthStencilTexture](metalkit/mtkview/depthstenciltexture.md)
- [depthStencilStorageMode](metalkit/mtkview/depthstencilstoragemode.md)
- [multisampleColorTexture](metalkit/mtkview/multisamplecolortexture.md)
