<!--
{
  "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/markCurrentPassAsFinished()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAssetWriterInput(im)markCurrentPassAsFinished"
  },
  "title" : "markCurrentPassAsFinished()"
}
-->

# markCurrentPassAsFinished()

Tells the input to analyze the appended media to determine whether it can improve the results by reencoding certain segments.

```
func markCurrentPassAsFinished()
```

## Discussion

When the value of the [`canPerformMultiplePasses`](/documentation/AVFoundation/AVAssetWriterInput/canPerformMultiplePasses) property is <doc://com.apple.documentation/documentation/Swift/true>, call this method after you append all of your media data. After the input determines if it warrants performing an additional pass, the value of [`currentPassDescription`](/documentation/AVFoundation/AVAssetWriterInput/currentPassDescription) changes (typically asynchronously) to describe how to set up for the next pass. Although it’s possible to use key-value observing to determine when the value of [`currentPassDescription`](/documentation/AVFoundation/AVAssetWriterInput/currentPassDescription) changes, it’s typically more convenient to call the [`respondToEachPassDescription(on:using:)`](/documentation/AVFoundation/AVAssetWriterInput/respondToEachPassDescription(on:using:)) method to start the work for each pass.

After reappending the media data for all of the time ranges of the new pass, call this method again to determine whether to reappend segments in another pass.

Calling this method effectively cancels any previous invocation of [`requestMediaDataWhenReady(on:using:)`](/documentation/AVFoundation/AVAssetWriterInput/requestMediaDataWhenReady(on:using:)), which means that you may call [`requestMediaDataWhenReady(on:using:)`](/documentation/AVFoundation/AVAssetWriterInput/requestMediaDataWhenReady(on:using:)) again for each new pass. This method provides a convenient way to consolidate these invocations in your code.

After each pass, you have the option of keeping the most recent results by calling [`markAsFinished()`](/documentation/AVFoundation/AVAssetWriterInput/markAsFinished()), instead of this method. If the value of [`currentPassDescription`](/documentation/AVFoundation/AVAssetWriterInput/currentPassDescription) is `nil` at the beginning of a pass, call [`markAsFinished()`](/documentation/AVFoundation/AVAssetWriterInput/markAsFinished()) to tell the input to not expect any further media data.

If the value of [`canPerformMultiplePasses`](/documentation/AVFoundation/AVAssetWriterInput/canPerformMultiplePasses) is <doc://com.apple.documentation/documentation/Swift/false>, the value of [`currentPassDescription`](/documentation/AVFoundation/AVAssetWriterInput/currentPassDescription) immediately becomes `nil` after calling this method.

> 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)