<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLCommandBuffer/waitUntilScheduled()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLCommandBuffer(im)waitUntilScheduled"
  },
  "title" : "waitUntilScheduled()"
}
-->

# waitUntilScheduled()

Blocks the current thread until the command queue schedules the buffer.

```
func waitUntilScheduled()
```

## Discussion

This method returns after the following events:

- The command queue *schedules* (see [`status`](/documentation/Metal/MTLCommandBuffer/status) and [`MTLCommandBufferStatus.scheduled`](/documentation/Metal/MTLCommandBufferStatus/scheduled)) the command buffer to run on the GPU.
- The command buffer invokes all the completion handlers your app submits with [`addScheduledHandler(_:)`](/documentation/Metal/MTLCommandBuffer/addScheduledHandler(_:)).

Use the [`waitUntilCompleted()`](/documentation/Metal/MTLCommandBuffer/waitUntilCompleted()) method to check for completion of the scheduled work.

---

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)