Please excuse my english, I'm not very fluent.
I have an application with 10 workouts, and i would like to give to each workout an amount of time, for ex : 1st workout : 30 seconds 2nd workout : 40 seconds
But for now, i only managed to give each workout the same amount of seconds for all workout..
This is what i used to work this :
#define EXERCISELENGTH 30
#define EXERCISELENGTH1 40
#define RESTLENGTH 10
- (void)tick
{
if (self.inCountdown && (countdown == 0)) {
self.inCountdown = NO;
self.inExercise = YES;
countdown = EXERCISELENGTH;
[self workoutUI];
[self updateUI];
workoutIndex++;
}
if (self.inExercise && (countdown == 0)) {
self.inExercise = NO;
self.inRest = YES;
countdown = RESTLENGTH;
[self restUI];
[self updateUI];
}
if (self.inRest && (countdown == 0)) {
self.inRest = NO;
self.inExercise = YES;
countdown = EXERCISELENGTH;
[self workoutUI];
[self updateUI];
workoutIndex++;
if (workoutIndex == 10) {
[self doneUI];
[self.timer invalidate];
return;
}
}
[self updateUI];
countdown--;
}
Any help would be appreciated.
Thank you