Returns the attributes for the character at a given index, and by reference the range over which the attributes apply.
- iOS 3.2+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
The index for which to return attributes. This value must not exceed the bounds of the receiver.
NULL, upon return contains the maximum range over which the attributes and values are the same as those at
index, clipped to
The range over which to search for continuous presence of the attributes at
index. This value must not exceed the bounds of the receiver.
index or any part of
range lies beyond the end of the receiver’s characters.
If you don’t need the range information, it’s far more efficient to use the
attributes(at: method to retrieve the attribute value.
For a list of possible attributes, see Character Attributes.