From b153c7e357fb785942cfb5426aeb70355b4f31a4 Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Mon, 24 Jun 2024 22:47:00 -0700 Subject: [PATCH] add intent to update CardViewModel --- .../Cards/Shared/CardViewModel.swift | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Sources/CareKitEssentials/Cards/Shared/CardViewModel.swift b/Sources/CareKitEssentials/Cards/Shared/CardViewModel.swift index 38342325..151f2756 100644 --- a/Sources/CareKitEssentials/Cards/Shared/CardViewModel.swift +++ b/Sources/CareKitEssentials/Cards/Shared/CardViewModel.swift @@ -62,8 +62,6 @@ open class CardViewModel: ObservableObject { /// A custom details information string to display for the task of the view model. public private(set) var detailsInformation: String? - // MARK: Private properties - /// Create an instance with specified content for an event. The view will update when changes /// occur in the store. /// - Parameters: @@ -81,4 +79,14 @@ open class CardViewModel: ObservableObject { self.event = event } + // MARK: Intents + + /// Update the current value with the latest valie. + /// - Parameters: + /// - value: The new value. + @MainActor + public func updateValue(_ value: OCKOutcomeValue) { + self.value = value + } + }