WIP
This commit is contained in:
@@ -49,7 +49,9 @@ class DataStore {
|
|||||||
AllMusclesFetchable().fetch(completion: { result in
|
AllMusclesFetchable().fetch(completion: { result in
|
||||||
switch result {
|
switch result {
|
||||||
case .success(let model):
|
case .success(let model):
|
||||||
self.allMuscles = model
|
self.allMuscles = model.sorted(by: {
|
||||||
|
$0.name < $1.name
|
||||||
|
})
|
||||||
case .failure(let error):
|
case .failure(let error):
|
||||||
print(error)
|
print(error)
|
||||||
}
|
}
|
||||||
@@ -59,7 +61,9 @@ class DataStore {
|
|||||||
AllEquipmentFetchable().fetch(completion: { result in
|
AllEquipmentFetchable().fetch(completion: { result in
|
||||||
switch result {
|
switch result {
|
||||||
case .success(let model):
|
case .success(let model):
|
||||||
self.allEquipment = model
|
self.allEquipment = model.sorted(by: {
|
||||||
|
$0.name ?? "a" < $1.name ?? "a"
|
||||||
|
})
|
||||||
case .failure(let error):
|
case .failure(let error):
|
||||||
print(error)
|
print(error)
|
||||||
}
|
}
|
||||||
@@ -69,7 +73,9 @@ class DataStore {
|
|||||||
AllExerciseFetchable().fetch(completion: { result in
|
AllExerciseFetchable().fetch(completion: { result in
|
||||||
switch result {
|
switch result {
|
||||||
case .success(let model):
|
case .success(let model):
|
||||||
self.allExercise = model
|
self.allExercise = model.sorted(by: {
|
||||||
|
$0.name < $1.name
|
||||||
|
})
|
||||||
case .failure(let error):
|
case .failure(let error):
|
||||||
print(error)
|
print(error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,32 +15,34 @@ struct CreateExerciseActionsView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
VStack {
|
||||||
if workoutExercise.exercise.isReps {
|
if workoutExercise.exercise.isReps {
|
||||||
VStack {
|
HStack {
|
||||||
HStack {
|
VStack {
|
||||||
VStack {
|
HStack {
|
||||||
HStack {
|
Text("Reps: ")
|
||||||
Text("Reps: ")
|
Text("\(workoutExercise.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()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
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 {
|
} else if workoutExercise.exercise.isDuration {
|
||||||
VStack{
|
VStack{
|
||||||
|
|||||||
@@ -22,6 +22,12 @@ struct WorkoutDetailView: View {
|
|||||||
TopButtonsView(workout: workout)
|
TopButtonsView(workout: workout)
|
||||||
.frame(height: 88)
|
.frame(height: 88)
|
||||||
|
|
||||||
|
Text(workout.name)
|
||||||
|
.font(.title3)
|
||||||
|
if let desc = workout.description {
|
||||||
|
Text(desc)
|
||||||
|
.font(.body)
|
||||||
|
}
|
||||||
CurrentWorkoutElapsedTimeView()
|
CurrentWorkoutElapsedTimeView()
|
||||||
ExerciseListView(workout: workout)
|
ExerciseListView(workout: workout)
|
||||||
CountdownView()
|
CountdownView()
|
||||||
|
|||||||
Reference in New Issue
Block a user