feat(watch): add lap detection via accelerometer and workout sync to phone

This commit is contained in:
2026-08-07 16:35:20 +02:00
parent 00a8220096
commit 48286041c6
8 changed files with 414 additions and 40 deletions
+9 -1
View File
@@ -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)
}
}
}
}