RiValT_ComplicationState
enum RiValT_ComplicationState
A read-only copy of the chosen host’s timer, shared by the Watch app and its widgets. This never runs an engine or advances a timer group on the Watch.
-
The WidgetKit kind shared by the complication and its timeline reload requests.
Declaration
Swift
static let kind: String -
The expected interval between phone confirmations of an unchanged countdown.
Declaration
Swift
static let confirmationInterval: TimeInterval -
The storage key for the encoded timer sample.
Declaration
Swift
private static let recordKey: String -
The storage key identifying the host selected for the complication.
Declaration
Swift
private static let sourceKey: String -
The storage key for the host-time cutoff after a disconnect.
Declaration
Swift
private static let disconnectedAtKey: String -
The app group preferences shared by the Watch app and complication.
Declaration
Swift
private static var defaults: UserDefaults? { get } -
The latest timer sample for the selected host and its timeline confirmation.
See moreDeclaration
Swift
struct Record : Codable -
Reads the current source’s sample and rewinds it if it predates the disconnect cutoff.
-
Changing hosts must never leave the previous device’s timer on the face.
Declaration
Swift
static func selectSource(_ source: String, in storage: UserDefaults? = defaults) -
Keep delayed background deliveries from restarting a countdown that has already lost its host.
Declaration
Swift
static func rewind(source: String, at hostDate: Date, in storage: UserDefaults? = defaults) -
Stores a current-source sample and requests a timeline reload when display state or confirmation changes. A confirmed live response clears the disconnect cutoff.
Declaration
Swift
static func save(_ snapshot: RiValT_RemoteState.Snapshot, updatedAt: Date, source: String, confirmed: Bool = false, localSampleDate: Date? = nil, in storage: UserDefaults? = defaults) -
Requests new timelines for the RVT complication on watchOS.
Declaration
Swift
private static func reload() -
Formats a nonnegative duration as minutes and seconds, adding hours when needed.
Declaration
Swift
static func clockText(_ seconds: Int) -> String
View on GitHub
Install in Dash