Latest 0.2.1
License MIT
Platforms ios 8.0, requires ARC

CI Status


Designed to be used in a SpriteKit project.


Create an instance of an SKTimer object

let timer = SKTimer()

Call the start(_:) method on your new timer passing in the current time from the scene. This is the currentTime parameter from your scenes update method. Usually you’ll want to create a property in your scene to hold this value so you’ll have access to it from outside your update method:


In your scenes update method make sure you call the timers update(_:completion:) method passing in the current time. This is how the timer calculates its count:

timer.update(currentTime, timeUp: nil)

You can get the current time of the timer from it time property:


Example Scene

Here is very simple example scene that starts an SKTimer on a touch:

import SpriteKit
import SKTimer

class GameScene: SKScene {

    var currentTime = 0.0
    var timer = SKTimer()

    override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {

    override func update(currentTime: CFTimeInterval) {
        self.currentTime = currentTime

        if timer.on {
            timer.update(currentTime, timeUp: nil)

Time Limits

You can set optional time limits for your timer and receive a callback when that limit is reached. Create a timer with a limit of 10 seconds like this:

var timer = SKTimer(limit: 10)


The default of the multiplier property is 1.0. You can increase or decrease this to speed up or slowdown the speed of the counter. E.g to create a timer that is twice as fast as real time:

var timer = SKTimer(multiplier: 2.0)


SKTimer is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "SKTimer"




SKTimer is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "SKTimer",
    "version": "0.2.1",
    "summary": "Easy to use timer for SpriteKit games.",
    "description": "Easy to set up and use timer for SpriteKit games. A few extra options to set a time limit and get notified when it is reached as well as the ability to speed up and slow down the timer.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "KyleGoslan": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.2.1"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "requires_arc": true,
    "source_files": "SKTimer"

Pin It on Pinterest

Share This