Caret

public struct Caret : Hashable, CustomStringConvertible

Caret position of a TextEngine.

  • Range of text this caret covers on a text engine

    Declaration

    Swift

    public var textRange: Text.TextRange
  • Position of this text caret.

    If position is CaretPosition.start, this value matches the value of start, otherwise this value matches end, instead.

    Declaration

    Swift

    public var location: Int { get }
  • Position of the caret within the text range.

    Declaration

    Swift

    public var position: CaretPosition
  • Start of text range this caret covers

    Declaration

    Swift

    public var start: Int { get }
  • end

    End of text range this caret covers

    Declaration

    Swift

    public var end: Int { get }
  • Length of text this caret covers

    Declaration

    Swift

    public var length: Int { get }
  • Declaration

    Swift

    public var description: String { get }