WIP
This commit is contained in:
@@ -49,7 +49,9 @@ class DataStore {
|
||||
AllMusclesFetchable().fetch(completion: { result in
|
||||
switch result {
|
||||
case .success(let model):
|
||||
self.allMuscles = model
|
||||
self.allMuscles = model.sorted(by: {
|
||||
$0.name < $1.name
|
||||
})
|
||||
case .failure(let error):
|
||||
print(error)
|
||||
}
|
||||
@@ -59,7 +61,9 @@ class DataStore {
|
||||
AllEquipmentFetchable().fetch(completion: { result in
|
||||
switch result {
|
||||
case .success(let model):
|
||||
self.allEquipment = model
|
||||
self.allEquipment = model.sorted(by: {
|
||||
$0.name ?? "a" < $1.name ?? "a"
|
||||
})
|
||||
case .failure(let error):
|
||||
print(error)
|
||||
}
|
||||
@@ -69,7 +73,9 @@ class DataStore {
|
||||
AllExerciseFetchable().fetch(completion: { result in
|
||||
switch result {
|
||||
case .success(let model):
|
||||
self.allExercise = model
|
||||
self.allExercise = model.sorted(by: {
|
||||
$0.name < $1.name
|
||||
})
|
||||
case .failure(let error):
|
||||
print(error)
|
||||
}
|
||||
|
||||
@@ -15,32 +15,34 @@ struct CreateExerciseActionsView: View {
|
||||
var body: some View {
|
||||
VStack {
|
||||
if workoutExercise.exercise.isReps {
|
||||
VStack {
|
||||
HStack {
|
||||
VStack {
|
||||
HStack {
|
||||
Text("Reps: ")
|
||||
Text("\(workoutExercise.reps)")
|
||||
}
|
||||
Stepper("", onIncrement: {
|
||||
workoutExercise.increaseReps()
|
||||
}, onDecrement: {
|
||||
workoutExercise.decreaseReps()
|
||||
})
|
||||
}
|
||||
Divider()
|
||||
VStack{
|
||||
HStack {
|
||||
Text("Weight: ")
|
||||
Text("\(workoutExercise.weight)")
|
||||
}
|
||||
Stepper("", onIncrement: {
|
||||
workoutExercise.increaseWeight()
|
||||
}, onDecrement: {
|
||||
workoutExercise.decreaseWeight()
|
||||
})
|
||||
HStack {
|
||||
VStack {
|
||||
HStack {
|
||||
Text("Reps: ")
|
||||
Text("\(workoutExercise.reps)")
|
||||
}
|
||||
Stepper("", onIncrement: {
|
||||
workoutExercise.increaseReps()
|
||||
}, onDecrement: {
|
||||
workoutExercise.decreaseReps()
|
||||
})
|
||||
.labelsHidden()
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
Divider()
|
||||
VStack{
|
||||
HStack {
|
||||
Text("Weight: ")
|
||||
Text("\(workoutExercise.weight)")
|
||||
}
|
||||
Stepper("", onIncrement: {
|
||||
workoutExercise.increaseWeight()
|
||||
}, onDecrement: {
|
||||
workoutExercise.decreaseWeight()
|
||||
})
|
||||
.labelsHidden()
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
} else if workoutExercise.exercise.isDuration {
|
||||
VStack{
|
||||
@@ -72,7 +74,7 @@ struct CreateExerciseActionsView: View {
|
||||
Divider()
|
||||
|
||||
Spacer()
|
||||
|
||||
|
||||
Button(action: {
|
||||
superset.deleteExerciseForChosenSuperset(exercise: workoutExercise)
|
||||
viewModel.objectWillChange.send()
|
||||
|
||||
@@ -22,6 +22,12 @@ struct WorkoutDetailView: View {
|
||||
TopButtonsView(workout: workout)
|
||||
.frame(height: 88)
|
||||
|
||||
Text(workout.name)
|
||||
.font(.title3)
|
||||
if let desc = workout.description {
|
||||
Text(desc)
|
||||
.font(.body)
|
||||
}
|
||||
CurrentWorkoutElapsedTimeView()
|
||||
ExerciseListView(workout: workout)
|
||||
CountdownView()
|
||||
|
||||
Reference in New Issue
Block a user