NavigationState.swift 353 B

12345678910111213141516
  1. import SwiftUI
  2. class NavigationState: ObservableObject {
  3. @Published var path = NavigationPath() // Tracks the navigation stack
  4. func resetToRoot() {
  5. path.removeLast(path.count) // Clears the navigation stack to return to root
  6. }
  7. }
  8. enum NavigationDestinations: String {
  9. case carbInput
  10. case bolusInput
  11. case bolusConfirm
  12. }