CFAttributedStringGetAttribute(_:_:_:_:)
Returns the value of a given attribute of an attributed string at a specified location.
Declaration
func CFAttributedStringGetAttribute(_ aStr: CFAttributedString!, _ loc: CFIndex, _ attrName: CFString!, _ effectiveRange: UnsafeMutablePointer<CFRange>!) -> CFTypeRef!Parameters
- aStr:
The attributed string to examine.
- loc:
The location in
strat which to determine the attributes.locmust not exceed the bounds ofstr. - attrName:
The name of the attribute whose value you want to determine.
- effectiveRange:
If not
NULL, upon return contains a range includinglocover which exactly the same set of attributes apply as atloc.
Return Value
The value of the specified attribute at the specified location in str. Ownership follows the The Get Rule.
Discussion
For performance reasons, a range returned in effectiveRange is not necessarily the maximal range. If you need the maximum range, you should use CFAttributedStringGetAttributeAndLongestEffectiveRange(_:_:_:_:_:).