<!--
{
  "availability" : [
    "iOS: 5.0.0 - 18.0.0",
    "iPadOS: 5.0.0 - 18.0.0",
    "macCatalyst: 13.1.0 - 18.0.0",
    "macOS: 10.8.0 - 15.0.0",
    "tvOS: 9.0.0 - 18.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVVideoComposition/isValid(for:timeRange:validationDelegate:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVVideoComposition(im)isValidForAsset:timeRange:validationDelegate:"
  },
  "title" : "isValid(for:timeRange:validationDelegate:)"
}
-->

# isValid(for:timeRange:validationDelegate:)

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

```
func isValid(for asset: AVAsset?, timeRange: CMTimeRange, validationDelegate: (any AVVideoCompositionValidationHandling)?) -> 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.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the time ranges of the composition’s instructions conform to validation requirements, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

Apple discourages using this method in iOS 16, tvOS 16, and macOS 13 or later. Use [`determineValidity(for:timeRange:validationDelegate:completionHandler:)`](/documentation/AVFoundation/AVVideoComposition/determineValidity(for:timeRange:validationDelegate:completionHandler:)) instead.

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)