feat(watch): add lap detection via accelerometer and workout sync to phone
This commit is contained in:
@@ -8,11 +8,13 @@ struct ContentView: View {
|
||||
VStack(spacing: 16) {
|
||||
if workoutManager.isWorkoutActive {
|
||||
ActiveWorkoutView(workoutManager: workoutManager)
|
||||
} else if workoutManager.selectedWorkout != nil {
|
||||
WorkoutDetailView(workoutManager: workoutManager)
|
||||
} else {
|
||||
WorkoutListView(workoutManager: workoutManager)
|
||||
}
|
||||
}
|
||||
.navigationTitle("SwimBuddy")
|
||||
.navigationTitle(workoutManager.isWorkoutActive ? "" : "SwimBuddy")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,6 +63,9 @@ struct WorkoutListView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.onDelete { indexSet in
|
||||
workoutManager.deleteSavedWorkouts(at: indexSet)
|
||||
}
|
||||
}
|
||||
|
||||
if workoutManager.completedWorkouts.count > 0 {
|
||||
@@ -81,6 +86,9 @@ struct WorkoutListView: View {
|
||||
.font(.caption)
|
||||
}
|
||||
}
|
||||
.onDelete { indexSet in
|
||||
workoutManager.deleteCompletedWorkouts(at: indexSet)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user