Restarting countdown
PedroAnibarro1 opened this issue · comments
Pedro Anibarro commented
Hi,
I'm trying to reset my countdown once it hit 0.
I have a call of function in the delegate countdownFinished() to set the countdown and start again.
The problem is that the label text is set up but it do not start.
Any idea?
Pedro Anibarro commented
Workaround
func countingAt(timeCounted timeCounted: NSTimeInterval, timeRemaining: NSTimeInterval){
switch timeRemaining {
case -1.0:
updateCountdown()
default:
print("Time Remaining: \(timeRemaining)")
}
}
keishi suzuki commented
hi. timer has already invalidated when countdown finished.
use countingAt
is the better workaround your wrote above.
MBO commented
Maybe its just me but the delegate does not work for me.
none this code executes
func countingAt(timeCounted timeCounted: NSTimeInterval, timeRemaining: NSTimeInterval) {
switch timeRemaining {
case 10:
print("10 seconds remaining")
case -1.0:
print("timer invalidated")
default:
print("Time Remaining: \(timeRemaining)")
}
}
Umair Javed commented
@PedroAnibarro1 Thanks for the solution mine works with case 1: instead for -1