RiValT_WatchDelegate
@MainActor
final class RiValT_WatchDelegate : NSObject
extension RiValT_WatchDelegate: WCSessionDelegate
The iPhone or iPad owns the timer. A Watch sends explicit, expiring commands against a state it has seen.
-
The timer and control sample exchanged with the Watch.
Declaration
Swift
typealias Snapshot = RiValT_RemoteState.Snapshot -
The phase displayed for the current timer sample.
Declaration
Swift
typealias Phase = RiValT_RemoteState.Phase -
An explicit control action the Watch can request.
Declaration
Swift
typealias TimerOperation = RiValT_RemoteState.TimerOperation -
The shared WatchConnectivity session when supported by the device.
Declaration
Swift
@MainActor private var session: WCSession? { get } -
The Bluetooth link used for a nearby iPad.
Declaration
Swift
@MainActor private let padLink: RiValT_BluetoothRemote -
The host’s authoritative model of timer groups and presets.
Declaration
Swift
@MainActor let timerModel: TimerModel -
The host identity, current control snapshot, and command revision.
Declaration
Swift
@MainActor private var host: RiValT_RemoteState.Host -
The last command revision announced to interactive remotes.
Declaration
Swift
@MainActor private var lastNotifiedRevision: Int -
The last timer phase announced to interactive remotes.
Declaration
Swift
@MainActor private var lastNotifiedPhase: Phase? -
The most recent timer sample sent to the complication.
Declaration
Swift
@MainActor private var lastComplicationSnapshot: Snapshot? -
The time when the host last sent a complication sample.
Declaration
Swift
@MainActor private var lastComplicationUpdate: Date -
Initializes the timer link and restores the host’s persisted presets.
Declaration
Swift
@MainActor init(activate: Bool = true)Parameters
activateWhether to activate the transports immediately.
-
Installs the transport callbacks and activates WatchConnectivity and the iPad Bluetooth link.
Declaration
Swift
@MainActor func activate() -
Persists the timer model and notifies remotes of its current state.
Declaration
Swift
@MainActor func updateSettings() -
Host callbacks can originate on the engine queue. Read its model and the UIKit navigation state on main.
Declaration
Swift
nonisolated func publishSnapshot() -
Scene callbacks publish synchronously so a background rewind is queued before suspension.
Declaration
Swift
@MainActor func publishCurrentSnapshot() -
Sends a changed or overdue complication sample, using priority delivery when available.
Declaration
Swift
@MainActor private func publishComplicationSnapshot() -
Reads the app’s current timer state and records it for command validation.
Declaration
Swift
@MainActor private func capture() -> Snapshot? -
Validates a remote request, applies any accepted command, and replies with the host’s current state.
Declaration
Swift
@MainActor private func answer(_ request: [String : Any], received: Date = Date(), reply: @escaping ([String : Any]) -> Void) -
Publishes the host state after WatchConnectivity activation.
Declaration
Swift
nonisolated func session(_ session: WCSession, activationDidCompleteWith state: WCSessionActivationState, error: Error?) -
Receives reachability changes. Host snapshots are published by model and scene updates.
Declaration
Swift
nonisolated func sessionReachabilityDidChange(_ session: WCSession) -
Receives the iPhone session’s inactive transition while watch pairing changes.
Declaration
Swift
nonisolated func sessionDidBecomeInactive(_ session: WCSession) -
Reactivates WatchConnectivity after the active watch session is replaced.
Declaration
Swift
nonisolated func sessionDidDeactivate(_ session: WCSession) -
Routes an interactive Watch message to the main queue with its receipt time.
Declaration
Swift
nonisolated func session(_ session: WCSession, didReceiveMessage message: [String: Any], replyHandler: @escaping ([String: Any]) -> Void)
View on GitHub
Install in Dash