<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMTimeRangeCopyAsDictionary(_:allocator:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@F@CMTimeRangeCopyAsDictionary"
  },
  "title" : "CMTimeRangeCopyAsDictionary(_:allocator:)"
}
-->

# CMTimeRangeCopyAsDictionary(_:allocator:)

Returns a dictionary representation of a time range.

```
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

A dictionary that represents the time range.

## 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](/documentation/CoreMedia/cmtimerange-dictionary-keys).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)