WatchModel

@MainActor
final class WatchModel : NSObject, ObservableObject, @preconcurrency WCSessionDelegate

This wraps the preferences in an observable wrapper.

  • The text report.

    Declaration

    Swift

    @Published
    @MainActor
    var text: String { get set }
  • The actual cleandate

    Declaration

    Swift

    @Published
    @MainActor
    var cleanDate: Date { get set }
  • Which screen to show

    Declaration

    Swift

    @Published
    @MainActor
    var watchFormat: Int { get set }
  • The task for rendering the text report

    Declaration

    Swift

    @MainActor
    private var textTask: Task<Void, Never>?
  • Tells the app to reload itself from the stored prefs. It does this in a separate thread, as rendering the keytags can take a while.

    Declaration

    Swift

    @MainActor
    func reloadFromPrefs()
  • Called when the app gets its context.

    Declaration

    Swift

    @MainActor
    func session(_: WCSession, didReceiveApplicationContext inContext: [String : Any])

    Parameters

    _

    Session. ignored

    didReceiveApplicationContext

    the app context

  • NOP

    Declaration

    Swift

    @MainActor
    func session(_: WCSession, activationDidCompleteWith: WCSessionActivationState, error: (any Error)?)

    Parameters

    _

    The session. ignored

    activationDidCompleteWith

    ignored

    error

    ignored