<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVAssetWriterInput/respondToEachPassDescription(on:using:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAssetWriterInput(im)respondToEachPassDescriptionOnQueue:usingBlock:"
  },
  "title" : "respondToEachPassDescription(on:using:)"
}
-->

# respondToEachPassDescription(on:using:)

Tells the input to invoke a callback whenever it begins a new pass.

```
func respondToEachPassDescription(on queue: dispatch_queue_t, using block: @escaping @Sendable () -> Void)
```

## Parameters

`queue`

The queue on which to invoke the callback.

`block`

A callback the input invokes at the beginning of each pass.

## Discussion

A typical implemementation of the callback block performs the following steps:

1. Gets the value of the [`currentPassDescription`](/documentation/AVFoundation/AVAssetWriterInput/currentPassDescription) property and configures media data source accordingly.
2. Calls the [`requestMediaDataWhenReady(on:using:)`](/documentation/AVFoundation/AVAssetWriterInput/requestMediaDataWhenReady(on:using:)) method to begin appending data for the current pass.

After you’ve appended all media data for the current pass, call the [`markCurrentPassAsFinished()`](/documentation/AVFoundation/AVAssetWriterInput/markCurrentPassAsFinished()) method have the system determine whether to perform another pass. If it performs an additional pass the system invokes the callback to begin the next pass. When it determines that it requires no additional passes, the system invokes the callback one final time so the client can invoke [`markAsFinished()`](/documentation/AVFoundation/AVAssetWriterInput/markAsFinished()) in response to the value of [`currentPassDescription`](/documentation/AVFoundation/AVAssetWriterInput/currentPassDescription) becoming `nil`.

> Important:
> Before calling this method, you must add the input to an asset writer and call the writer’s ``doc://com.apple.avfoundation/documentation/AVFoundation/AVAssetWriter/startWriting()`` method.

---

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)