Currently I am trying to Create a 3...2...1... Go! type of count down where right after Go! is stated an action occurs however the option to use the completion handler for Timer.scheduleTimer doesn't have the ability to countdown from what I understand?
As of now I can count down from 3 but don't know how to invalidate the timer at Go! and perform an action
var seconds = 3
var countDownTimer = Timer()
func startCountDown() {
countDownTimer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(TrackActivityVC.updateTimer), userInfo: nil, repeats: true)
}
func updateTimer() {
seconds -= 1
print(seconds)
}
// Not sure how to use this code to create a countdown, as it doesn't seem possible with this method
Timer.scheduledTimer(withTimeInterval: someInterval, repeats: false) {
}
Thus the question is How to make count down timer with completion handler.