---
title: "isValid(for:assetDuration:timeRange:validationDelegate:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avvideocomposition/isvalid(for:assetduration:timerange:validationdelegate:)"
---

# isValid(for:assetDuration:timeRange:validationDelegate:)

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

## Declaration

```swift
func isValid(for tracks: [AVAssetTrack], assetDuration duration: CMTime, timeRange: CMTimeRange, validationDelegate: (any AVVideoCompositionValidationHandling)?) -> Bool
```

## Parameters

- `tracks`: Pass a reference to an asset’s tracks if you wish to validate the track IDs of the layer instructions against the asset’s tracks. Pass nil to skip that validation. This method throws an exception if the tracks aren’t all from the same asset.
- `duration`: Pass the asset duration to validate the time ranges of the instructions. Pass doc://com.apple.documentation/documentation/CoreMedia/CMTime/invalid to skip that validation.
- `timeRange`: The composition only validates those instructions with time ranges that overlap with the specified time range. To validate all instructions that the composition may use for playback or other processing, regardless of time range, pass CMTimeRange(start: .zero, end: .positiveInfinity).
- `validationDelegate`: A delegate that handles validation requests. May be nil.

## Return Value

Return Value true if the validation succeeds; otherwise; false.

## See Also

### Validating the time range

- [AVVideoCompositionValidationHandling](avfoundation/avvideocompositionvalidationhandling.md)
- [determineValidity(for:timeRange:validationDelegate:completionHandler:)](avfoundation/avvideocomposition/determinevalidity(for:timerange:validationdelegate:completionhandler:).md)
- [isValid(for:timeRange:validationDelegate:)](avfoundation/avvideocomposition/isvalid(for:timerange:validationdelegate:).md)
