<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFRangeMake(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFRangeMake"
  },
  "title" : "CFRangeMake(_:_:)"
}
-->

# CFRangeMake(_:_:)

Declares and initializes a `CFRange` structure.

```
func CFRangeMake(_ loc: CFIndex, _ len: CFIndex) -> CFRange
```

## Parameters

`loc`

The starting location of the range.

`len`

The length of the range.

## Return Value

An initialized structure of type [`CFRange`](/documentation/CoreFoundation/CFRange).

## Discussion

This is an in-line convenience function for creating initialized [`CFRange`](/documentation/CoreFoundation/CFRange) structures.

---

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)