---
title: "range(of:at:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsattributedstring/range(of:at:)-6um0x"
---

# range(of:at:)

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

## Declaration

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

## Parameters

- `list`: The text list.
- `location`: The location in the text list.

## Return Value

Return Value The range of the given text list containing the location.

## See Also

### Calculating ranges for common elements

- [itemNumber(in:at:)](foundation/nsattributedstring/itemnumber(in:at:).md)
- [range(of:at:)](foundation/nsattributedstring/range(of:at:)-1wrcp.md)
- [range(of:at:)](foundation/nsattributedstring/range(of:at:)-3fevu.md)
