Instance Method

accessibilityStyleRange(for:)

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

Required.

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

func accessibilityString(for: NSRange) -> String?

Returns the substring for the specified range.

Required.

func accessibilityAttributedString(for: NSRange) -> NSAttributedString?

Returns the attributed substring for the specified range of characters.

Required.

func accessibilityRTF(for: NSRange) -> Data?

Returns the Rich Text Format (RTF) data that describes the specified range of characters.

Required.

func accessibilityFrame(for: NSRange) -> NSRect

Returns the rectangle enclosing the specified range of characters.

Required.

func accessibilityLine(for: Int) -> Int

Returns the line number for the line holding the specified character index.

Required.

func accessibilityRange(for: Int) -> NSRange

Returns the range of characters for the glyph that includes the specified character.

Required.

func accessibilityRange(forLine: Int) -> NSRange

Returns the range of characters in the specified line.

Required.

func accessibilityRange(for: NSPoint) -> NSRange

Returns the range of characters for the glyph at the specified point.

Required.