In Swift, you can use:
Do not use in the Sprite Kit NSTimer, GCD or performSelector:afterDelay:because these synchronization methods ignore the state of the node, scene, or paused view. In addition, you do not know at what point in the game cycle they are being executed, which can cause a lot of problems depending on what your code actually does.
var actionwait = SKAction.waitForDuration(0.5)
var timesecond = Int()
var actionrun = SKAction.runBlock({
timescore++
timesecond++
if timesecond == 60 {timesecond = 0}
scoreLabel.text = "Score Time: \(timescore/60):\(timesecond)"
})
scoreLabel.runAction(SKAction.repeatActionForever(SKAction.sequence([actionwait,actionrun])))
user1671097