BasalProfileEditorDataFlow.swift 653 B

123456789101112131415161718192021222324252627282930
  1. import SwiftDate
  2. import SwiftUI
  3. enum BasalProfileEditor {
  4. enum Config {
  5. static let maxItemsCount = 48
  6. }
  7. class Item: Identifiable, Hashable, Equatable {
  8. let id = UUID()
  9. var rateIndex = 0
  10. var timeIndex = 0
  11. init(rateIndex: Int, selectedIndex: Int) {
  12. self.rateIndex = rateIndex
  13. timeIndex = selectedIndex
  14. }
  15. static func == (lhs: Item, rhs: Item) -> Bool {
  16. lhs.timeIndex == rhs.timeIndex
  17. }
  18. func hash(into hasher: inout Hasher) {
  19. hasher.combine(timeIndex)
  20. }
  21. }
  22. }
  23. protocol BasalProfileEditorProvider: Provider {}