How can I create a seconds counter which I can stop it and then resume from where I stopped it?
I've create this timer:
func countSeconds() {
secondsTimer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(addSeconds), userInfo: nil, repeats: true)
}
@objc func addSeconds() {
seconds += 1
}
but with invalidate method I don't resume from where I stopped the timer.