---
title: "CMTimeRangeCopyAsDictionary(_:allocator:)"
framework: Core Media
role: symbol
role_heading: Function
platforms: [iOS 4.0+, iPadOS 4.0+, Mac Catalyst 13.1+, macOS 10.7+, tvOS 9.0+, visionOS 1.0+, watchOS 6.0+]
path: "coremedia/cmtimerangecopyasdictionary(_:allocator:)"
---

# CMTimeRangeCopyAsDictionary(_:allocator:)

Returns a dictionary representation of a time range.

## Declaration

```swift
func CMTimeRangeCopyAsDictionary(_ range: CMTimeRange, allocator: CFAllocator?) -> CFDictionary?
```

## Parameters

- `range`: The time range from which to create a dictionary.
- `allocator`: The allocator with which to create a dictionary.

## Return Value

Return Value A dictionary that represents the time range.

## Discussion

Discussion This is useful when putting CMTimeRanges in Core Foundation container types. Pass kCFAllocatorDefault to use the default allocator. For keys in the dictionary, see Dictionary Keys.

## See Also

### Utility Functions

- [CMTimeClampToRange(_:range:)](coremedia/cmtimeclamptorange(_:range:).md)
- [CMTimeMapDurationFromRangeToRange(_:fromRange:toRange:)](coremedia/cmtimemapdurationfromrangetorange(_:fromrange:torange:).md)
- [CMTimeMapTimeFromRangeToRange(_:fromRange:toRange:)](coremedia/cmtimemaptimefromrangetorange(_:fromrange:torange:).md)
- [CMTimeRangeCopyDescription(allocator:range:)](coremedia/cmtimerangecopydescription(allocator:range:).md)
- [CMTimeRangeShow(_:)](coremedia/cmtimerangeshow(_:).md)
