Created
December 3, 2017 09:11
-
-
Save shuiRong/e2a9b31db2b3cc207166146d715db5cf to your computer and use it in GitHub Desktop.
Timer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var timer = Timer() | |
timer = Timer.scheduledTimer(timeInterval: 0.1, target: self, selector: #selector(ViewController.updateTimer), userInfo: nil, repeats: true) | |
//更新timer | |
func updateTimer() { | |
counter = counter + 0.1 | |
timeLabel.text = String(format: "%.1f", counter) + "--" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment