Instance Method


Returns a Boolean value that indicates whether a given array of track segments conform to the timing rules for a composition track.


func validateSegments(_ trackSegments: [AVCompositionTrackSegment]) throws



An array of AVCompositionTrackSegment objects.


If validation fails, on return contains an NSError object that describes the problem.

Return Value

true if the track segments in trackSegments conform to the timing rules for a composition track, otherwise false.


You can use this method to ensure that an array of track segments is suitable for setting as the value of the segments property. The of the first track segment must be kCMTimeZero, and the of each subsequent track segment must equal CMTimeRangeGetEnd(<#previousTrackSegment#>

If you want to modify the existing segments array, you can create a mutable copy of it, modify the mutable array, and then validate the mutable array using this method.