Returns the index of the character falling under the given point, expressed in the given container's coordinate system.
- iOS 7.0+
- macOS 10.6+
- Mac Catalyst 13.0+
- tvOS 9.0+
The point to test.
The text container within which the point is tested.
A fraction of the distance from the insertion point, logically before the given character to the next one.
The index of the character falling under
glyph, but expressed in character index terms. The method returns the index of the character falling under
point, expressed in coordinate system of
container; if no character is under the point, the nearest character is returned, where nearest is defined according to the requirements of selection by mouse. However, this is not simply equivalent to taking the result of the corresponding glyph index method and converting it to a character index, because in some cases a single glyph represents more than one selectable character, for example an fi ligature glyph. In that case, there is an insertion point within the glyph, and this method returns one character or the other, depending on whether the specified point lies to the left or the right of that insertion point.
In general, this method returns only character indexes for which there is an insertion point. The
partial is a fraction of the distance from the insertion point, logically before the given character to the next one, which may be either to the right or to the left depending on directionality.