---
title: "CFAttributedStringGetAttributesAndLongestEffectiveRange(_:_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfattributedstringgetattributesandlongesteffectiverange(_:_:_:_:)"
---

# CFAttributedStringGetAttributesAndLongestEffectiveRange(_:_:_:_:)

Returns the attributes of an attributed string at a specified location.

## Declaration

```swift
func CFAttributedStringGetAttributesAndLongestEffectiveRange(_ aStr: CFAttributedString!, _ loc: CFIndex, _ inRange: CFRange, _ longestEffectiveRange: UnsafeMutablePointer<CFRange>!) -> CFDictionary!
```

## Parameters

- `aStr`: The attributed string to examine.
- `loc`: The location in str at which to determine the attributes. loc must not exceed the bounds of str.
- `inRange`: The range in str within to find the longest effective range of the attributes at loc. inRange must not exceed the bounds of str.
- `longestEffectiveRange`: If not NULL, upon return contains the maximal range within inRange over which the exact same set of attributes apply. The returned range is clipped to inRange.

## Return Value

Return Value A dictionary that contains the attributes of str at the specified location. Ownership follows the The Get Rule.

## See Also

### Accessing Attributes

- [CFAttributedStringGetAttribute(_:_:_:_:)](corefoundation/cfattributedstringgetattribute(_:_:_:_:).md)
- [CFAttributedStringGetAttributes(_:_:_:)](corefoundation/cfattributedstringgetattributes(_:_:_:).md)
- [CFAttributedStringGetAttributeAndLongestEffectiveRange(_:_:_:_:_:)](corefoundation/cfattributedstringgetattributeandlongesteffectiverange(_:_:_:_:_:).md)
