Contents

accessibilityStyleRange(for:)

Returns a range of characters that all have the same style as the specified character.

Declaration

func accessibilityStyleRange(for index: Int) -> NSRange

Parameters

  • index:

    The index of the specified character.

Return Value

A range of characters with the same style as the specified character.

Discussion

This method returns a range of characters that meet two conditions: The range must include the specified character, and all the other characters in the range must match the specified character’s style. If none of the adjacent characters match the specified character’s style, the method returns only the specified character.

See Also

Configuring text elements