0

I am creating a workout app for my son and he selects a workout name, then sets of the workout he will do, and the reps of the workout he will do.

I make it so he can do 3 sets, but they all have the same amount of reps. I have a workoutEntity that I want to add a new attribute that can have the number of reps for each set. (So he can do bench press 3 sets that are 12 reps, 10 reps, 8 reps, instead of just 3 sets of 12 reps).

I've been to have the user type all different sets with commas in between and store them in a string, but it just doesn't seem like the best route to go for this purposes. Is there a way to create an array in core data, in which the user defines the length of it? (Since the user decides how many sets he needs to do, the amount of sets will be the length.)

I was looking at relationships of core data, with creating a set entity that has attribute rep, but I couldn't get it to be a one-to-many relationship. New to SWIFT language, but so far it is interesting.

Thank you

Michael McMullin
  • 1,450
  • 1
  • 14
  • 25

0 Answers0