Contents

CMTimeClampToRange(_:range:)

Returns the nearest time value inside the time range.

Declaration

func CMTimeClampToRange(_ time: CMTime, range: CMTimeRange) -> CMTime

Parameters

  • time:

    The time to clamp.

  • range:

    The time range to examine.

Return Value

A time structure inside the time range.

Discussion

The function returns the times inside the range you specify unmodified. Times before the start and after the end time of the time range return the start and end time of the range. If the CMTimeRange argument is empty, this function returns an invalid CMTime. If the given CMTime is invalid, the function returns an invalid CMTime.

See Also

Utility Functions