<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLCommandBufferHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:@T@MTLCommandBufferHandler"
  },
  "title" : "MTLCommandBufferHandler"
}
-->

# MTLCommandBufferHandler

A completion handler signature a GPU device calls when it finishes scheduling a command buffer, or when the GPU finishes running it.

```
typealias MTLCommandBufferHandler = @Sendable (any MTLCommandBuffer) -> Void
```

## Parameters

`commandBuffer`

The [`MTLCommandBuffer`](/documentation/Metal/MTLCommandBuffer) instance that’s invoking the completion handler.

## Discussion

The [`MTLCommandBuffer`](/documentation/Metal/MTLCommandBuffer) type uses this signature in its methods that register your completion handlers, including [`addScheduledHandler(_:)`](/documentation/Metal/MTLCommandBuffer/addScheduledHandler(_:)) and [`addCompletedHandler(_:)`](/documentation/Metal/MTLCommandBuffer/addCompletedHandler(_:)).

---

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)