TextEngineType

public protocol TextEngineType : AnyObject

A minimal interface for a text engine.

Mainly implemented by TextEngine.

  • Gets the caret range.

    To change the caret range, use setCaret().

    Declaration

    Swift

    var caret: Caret { get }
  • Inserts the specified text on top of the current caret position.

    Replaces text if caret’s range is > 0.

    Declaration

    Swift

    func insertText(_ text: String)
  • Deletes the text before the starting position of the caret.

    Declaration

    Swift

    func backspaceText()
  • Deletes the text exactly on top of the caret.

    Declaration

    Swift

    func deleteText()
  • Sets the caret range for the text.

    If caret.Length > 0, the caret is treated as a selection range.

    Declaration

    Swift

    func setCaret(_ caret: Caret)