LiveActitiyAttributes.swift 774 B

12345678910111213141516171819202122232425262728293031
  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: [Decimal]
  15. let chartDate: [Date?]
  16. let rotationDegrees: Double
  17. let highGlucose: Decimal
  18. let lowGlucose: Decimal
  19. let cob: Decimal
  20. let iob: Decimal
  21. let unit: String
  22. let isOverrideActive: Bool
  23. }
  24. let startDate: Date
  25. }