Timer (novice)
-
I am working on a countdown timer app that chimes when it reaches 0. I want the timer to recycle after the chime and countdown again until the stop button is pressed. I am a non-programmer that is doing this for fun, I just need some sample code to get over this hurdle. Any assistance would be greatly appreciated. func counter() { seconds -= 1 label.text = String(seconds) + " Seconds" if (seconds == 0) { timer.invalidate() audioPlayer.play() } } I want the timer to start over automatically after the audioPlayer stops.
-
I am working on a countdown timer app that chimes when it reaches 0. I want the timer to recycle after the chime and countdown again until the stop button is pressed. I am a non-programmer that is doing this for fun, I just need some sample code to get over this hurdle. Any assistance would be greatly appreciated. func counter() { seconds -= 1 label.text = String(seconds) + " Seconds" if (seconds == 0) { timer.invalidate() audioPlayer.play() } } I want the timer to start over automatically after the audioPlayer stops.