It depends on how the different workouts look like.
For all similar workout (I mean, a similar set of informations to display, may be with plus or minus some specific), you can have a single view.
Create an enum with all your workouts (I am inventing workout names, just to illustrate)
enum Workouts {
case shoulderStretch
case shoulderRelax
case backRoll
case backStrengthen
case biceps
// etc
}
In WorkOutView, create
var workoutToPresent : Workouts?
Then, in viewDidLoad, set the different fields values depending on workoutToPresent
To go from tableView to this WorkoutView, create the segue from the main view (control-drag from the toplet icon at the top of viewController in IB to the WorkoutView controller. Give an ID to this segue.
In MainViewController create a var to hold the selectedWorkout (an item of the enum with all your workouts)
Then, in tableViewDidSelect, you will
- set selectedWorkout, such as selectedWorkout = .shoulderRelax
- call performSegue
In prepare for segue, you pass the selectedWorkout value
destVC.workoutToPresent = selectedWorkout
You can hide / show some fields if there is some specifics for this workout.
If you have really different workouts types (for instance 3, for top of boddy, for middle, for bottom) then you can create a 3 different views for workouts : WorkoutTopViewController, WorkoutMiddleViewController, WorkoutBottomViewController, create 3 segues from Main to each of the 3 VC.
And proceed as above for each.