add WorkoutStateManager for ViewModel functionality
This commit is contained in:
@@ -15,7 +15,6 @@ public class Defaults: ObservableObject {
|
||||
// TODO: isOnboarding should be true before shipping
|
||||
@AppStorage("isOnboarding") public var isOnboarding = false
|
||||
@AppStorage("isTrainerMode") public var isTrainerMode = false
|
||||
@AppStorage("isWorkingOut") public var isWorkingOut = false
|
||||
|
||||
@AppStorage("userId") public var userId = UUID().uuidString
|
||||
@AppStorage("defaultWorkoutId") public var defaultWorkoutId: String = ""
|
||||
|
||||
@@ -14,6 +14,20 @@ class NavigationManager: ObservableObject {
|
||||
path = NavigationPath()
|
||||
path.append(destination)
|
||||
}
|
||||
|
||||
func popToRoot() {
|
||||
path = NavigationPath()
|
||||
}
|
||||
|
||||
func pop() {
|
||||
if !path.isEmpty {
|
||||
path.removeLast()
|
||||
}
|
||||
}
|
||||
|
||||
func push(_ destination: NavigationDestination) {
|
||||
path.append(destination)
|
||||
}
|
||||
}
|
||||
|
||||
enum NavigationDestination: Hashable {
|
||||
|
||||
Reference in New Issue
Block a user