swiftでカウントダウンタイマーを作る
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というのが測る間隔値みたい
Author And Source
この問題について(swiftでカウントダウンタイマーを作る), 我々は、より多くの情報をここで見つけました https://qiita.com/naoneet/items/9f5169072b2339a0df15著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .