<!--
{
  "availability" : [
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSAttributedString/range(of:at:)-6um0x",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSAttributedString(im)rangeOfTextList:atIndex:"
  },
  "title" : "range(of:at:)"
}
-->

# range(of:at:)

Returns the range of the specified text list that contains the specified location.

```
func range(of list: NSTextList, at location: Int) -> NSRange
```

## Parameters

`list`

The text list.

`location`

The location in the text list.

## Return Value

The range of the given text list containing the location.

## Discussion

---

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)