LiveActitiyAttributes.swift 960 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. let showCOB: Bool
  11. let showIOB: Bool
  12. let showCurrentGlucose: Bool
  13. let showUpdatedLabel: Bool
  14. let itemOrder: [String]
  15. /// true for the first state that is set on the activity
  16. let isInitialState: Bool
  17. }
  18. public struct ContentAdditionalState: Codable, Hashable {
  19. let chart: [Decimal]
  20. let chartDate: [Date?]
  21. let rotationDegrees: Double
  22. let highGlucose: Decimal
  23. let lowGlucose: Decimal
  24. let target: Decimal
  25. let cob: Decimal
  26. let iob: Decimal
  27. let unit: String
  28. let isOverrideActive: Bool
  29. }
  30. let startDate: Date
  31. }