In your action method, after you check that the timer is not running, but before you set up the time, change the check value to YES
:
- (IBAction)startTimerButtonClicked:(UIButton *)sender
{
if (!self.timerIsRunning) // Run timer only if it's not allready running
{
// Time is running now
self.timerIsRunning = YES;
[self setupTimer]; // Start the timer
}
else
{
NSLog(@"Timer should pause with secondsCounter: %d and not continue to run", secondsCounter);
}
}
If you don't do this here—or in -setupTimer
there is a 1 second window where more taps will cause more timers since the timer doesn't fire until the first second is up.