---
title: "CMTimeMappingMake(source:target:)"
framework: Core Media
role: symbol
role_heading: Function
platforms: [iOS 9.0+, iPadOS 9.0+, Mac Catalyst 13.1+, macOS 10.11+, tvOS 9.0+, visionOS 1.0+, watchOS 6.0+]
path: "coremedia/cmtimemappingmake(source:target:)"
---

# CMTimeMappingMake(source:target:)

Creates a time mapping with a source and target time range.

## Declaration

```swift
func CMTimeMappingMake(source: CMTimeRange, target: CMTimeRange) -> CMTimeMapping
```

## Parameters

- `source`: A time range on the source timeline.
- `target`: A time range on the target timeline.

## Return Value

Return Value A new time mapping.

## Discussion

Discussion The source and target parameters must have durations whose epoch is 0, otherwise the system returns an invalid time mapping.

## See Also

### Creating Time Mappings

- [CMTimeMappingMakeEmpty(target:)](coremedia/cmtimemappingmakeempty(target:).md)
- [CMTimeMappingMakeFromDictionary(_:)](coremedia/cmtimemappingmakefromdictionary(_:).md)
