---
title: "determineValidity(for:timeRange:validationDelegate:completionHandler:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avvideocomposition/determinevalidity(for:timerange:validationdelegate:completionhandler:)"
---

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

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

## Declaration

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

```swift
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 doc://com.apple.avfoundation/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

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 object contained therein during validation.

## See Also

### Validating the time range

- [isValid(for:assetDuration:timeRange:validationDelegate:)](avfoundation/avvideocomposition/isvalid(for:assetduration:timerange:validationdelegate:).md)
- [AVVideoCompositionValidationHandling](avfoundation/avvideocompositionvalidationhandling.md)
- [isValid(for:timeRange:validationDelegate:)](avfoundation/avvideocomposition/isvalid(for:timerange:validationdelegate:).md)
