swiftでカウントダウンタイマーを作るテンプレです
var secondsRemaining = 60
var timer = Timer()
timer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(updateCounter), userInfo: nil, repeats: true)
}
@objc func updateCounter() {
//example functionality
if secondsRemaining > 0 {
print("\(secondsRemaining) seconds to the end of the world")
secondsRemaining -= 1
}
}
timeIntervalというのが測る間隔値みたい