Hello I have a swift file that contains arrays of tuples that I reference with my app. For example, my structure looks like:
struct workoutDict {
static var bicepWorkouts = [("Barbell Curl","Bicep",0,"3x10"), ("x","x",3,"x")]
}
I have a global variable named eqID. For example, eqID = "bicepWorkouts"
There is part of my code where I attempt to call this dictionary. Normally I would use: workoutDict.bicepWorkouts and this works fine, but I have other workouts such as barbellWorkouts in my dictionary so i let the user select "bicepWorkouts", "barbellWorkouts" ect based on user input and need to use that to reference my struct.
Right now i have
//Call the global variable to get what workout to look for
code = eqID
let ourWorkouts = workoutDict.code
which should set ourWorkouts = workoutDict.bicepWorkouts when our eqID is set to that, but it keeps giving me the error that workoutDict does not contain the code when I use that reference.
I tried researching alternate methods of referencing structs but I couldn't find anything. Any help would be appreciated!