Instance Method


Returns the baseline position of a given character relative to the origin of rectangle returned by firstRect(forCharacterRange:actualRange:).


optional func baselineDeltaForCharacter(at anIndex: Int) -> CGFloat



Index of the character whose baseline is tested.

Return Value

The vertical distance, in points, between the baseline of the character at anIndex and the rectangle origin.


Implementation of this method is optional. This information allows the caller to determine finer-grained character positioning within the text storage of the text view adopting NSTextInputClient.

See Also

Optional Methods

func attributedString() -> NSAttributedString

Returns an attributed string representing the receiver's text storage.

func fractionOfDistanceThroughGlyph(for: NSPoint) -> CGFloat

Returns the fraction of the distance from the left side of the character to the right side that a given point lies.

func windowLevel() -> Int

Returns the window level of the receiver.

func drawsVerticallyForCharacter(at: Int) -> Bool

Informs the text input management system whether the protocol-conforming client renders the character at the given index vertically.