Restart of Match Game

Can you share your code please?

sure.

in the func resetApp you are selection 5 seconds, not 50 (it should be 50,000 milliseconds). Also try to check the if statement in the timerFired function. The if == 0 should stop the timer when getting to 0

Sorry to disturb. The timer still goes in negative. and suppose if i finish the game before 5 mins and when i click on ok the game starts from reducing that 5 mins. The timer actually not starts from the beginning. and I also checked in timer method.

Right…please share your code for the timerFire function

all the code seems right, I don’t know if this is going to solve, but try to leave a space at the beginning between the parenthesis and the key.
@objc func timerFired**() {**

Thank you, thank you, thank you!
I was tearing my hair out trying to reset the game - this feels a bit like duplicated code - why can’t I just say go back to the beginning… but it works.
I feel there should be a better “model” for reset or initial behaviour - or if I have a reset function - I should call it from all places that need it.

1 Like