LiveActitiyShared.swift 711 B

1234567891011121314151617181920212223242526272829
  1. import ActivityKit
  2. import Foundation
  3. struct LiveActivityAttributes: ActivityAttributes {
  4. public struct ContentState: Codable, Hashable {
  5. let bg: String
  6. let direction: String?
  7. let change: String
  8. let date: Date
  9. let detailedViewState: ContentAdditionalState?
  10. /// true for the first state that is set on the activity
  11. let isInitialState: Bool
  12. }
  13. public struct ContentAdditionalState: Codable, Hashable {
  14. let chart: [Double]
  15. let chartDate: [Date?]
  16. let rotationDegrees: Double
  17. let highGlucose: Double
  18. let lowGlucose: Double
  19. let cob: Decimal
  20. let iob: Decimal
  21. }
  22. let startDate: Date
  23. }