stop
timer.invalidate();
var timerCount = 0
var timerRunning = false
var timer = NSTimer()
start:
timer = NSTimer.scheduledTimerWithTimeInterval(1, target:self, selector: Selector("Counting"), userInfo: nil, repeats: true)
timerRunning = true, false
func Counting () {
timerCount += 1
timerLabel.text = "\(timerCount)"
}
restart:
timerCount = 0
timerLabel.text = "0"
Không có nhận xét nào:
Đăng nhận xét