LavaUI docs GitHub

enum CaretBlink

Swift

Properties

static var isVisible: Bool { get }

Whether the caret should be drawn right now.

Sources/LavaUI/Focus.swift:180

static let period: Double

One full blink, in seconds: shown for the first half, hidden for the second.

Sources/LavaUI/Focus.swift:169

Methods

static func noteEdit()

Records an edit, which holds the caret solid for half a second so it is visible while typing.

Sources/LavaUI/Focus.swift:174

static func phaseChanged() -> Bool

Call once per frame while a field is focused: reports whether the blink phase flipped, which is the only reason an idle app needs to redraw.

Sources/LavaUI/Focus.swift:189

static func resync()

Adopts the current phase without reporting a change. The blink is suspended while the window is invisible, so lastPhase is stale by an arbitrary number of periods on restore; the caller redraws once anyway and only wants the next phaseChanged() to be meaningful.

Sources/LavaUI/Focus.swift:200