<!--
{
  "availability" : [
    "iOS: 16.0.0 - 18.0.0",
    "iPadOS: 16.0.0 - 18.0.0",
    "macCatalyst: 16.0.0 - 18.0.0",
    "macOS: 13.0.0 - 15.0.0",
    "tvOS: 16.0.0 - 18.0.0",
    "visionOS: 1.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVVideoComposition/determineValidity(for:timeRange:validationDelegate:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVVideoComposition(im)determineValidityForAsset:timeRange:validationDelegate:completionHandler:"
  },
  "title" : "determineValidity(for:timeRange:validationDelegate:completionHandler:)"
}
-->

# determineValidity(for:timeRange:validationDelegate:completionHandler:)

Determines whether the time ranges of the composition’s instructions conform to validation requirements.

```
func determineValidity(for asset: AVAsset?, timeRange: CMTimeRange, validationDelegate: (any AVVideoCompositionValidationHandling)?, completionHandler: @escaping @Sendable (Bool, (any Error)?) -> Void)
```

```
func isValid(for asset: AVAsset?, timeRange: CMTimeRange, validationDelegate: (any AVVideoCompositionValidationHandling)?) async throws -> Bool
```

## Parameters

`asset`

An asset object, if you require validating the time ranges of the instructions against the duration of the asset and the track IDs of the layer instructions against the asset’s tracks. Pass `nil` to skip that validation.

`timeRange`

A time range over which to validate instructions. The method validates only instructions with time ranges that overlap with this time range. To validate all instructions that you can use for playback or other processing, regardless of time range, pass `CMTimeRange(start: .zero, duration: .positiveInfinity)`.

`validationDelegate`

An object that adopts the [`AVVideoCompositionValidationHandling`](/documentation/AVFoundation/AVVideoCompositionValidationHandling) protocol to receive detailed information about problematic sections of a video composition during processing. Pass `nil` if you don’t require the details.

`completionHandler`

A block the system calls when it determines whether the video composition is valid.

## Discussion

During validation, the video composition calls the validation delegate, if one exists, with a reference to any trouble spots in the video composition.

This method raises an exception if the delegate modifies the video composition’s instructions, or the array of layer instructions of any [`AVVideoCompositionInstruction`](/documentation/AVFoundation/AVVideoCompositionInstruction-swift.class) object contained therein during validation.

---

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)