How to properly animate SKSpriteNode subclasses
<p>I designed a SKSpriteNode subclass <code>Ship</code>, and I want to know how to go about animating it with a couple different images. I'm currently passing in an original image with:</p>

<pre><code>class Ship:SKSpriteNode{
    static var shipImage = SKTexture(imageNamed:"Sprites/fullShip.png")

        init(startPosition startPos:CGPoint, controllerVector:CGVector){
            super.init(texture: Ship.shipImage, color: UIColor.clearColor(), size: Ship.shipImage.size())
</code></pre>

<p>but I'm not sure how to loop through an image atlas afterwards. I first attempted using a method inside the class that was then called in the <code>update</code> function: </p>

<pre><code>func animateShip() {
    self.runAction(SKAction.repeatActionForever(
        SKAction.animateWithTextures(shipAnimationFrames,
            timePerFrame: 0.2,
            resize: false,
            restore: true)),
            withKey:"shipBlink")

        print("animate")
    }
</code></pre>

<p><code>var shipAnimationFrames : [SKTexture]!</code> is declared right above <code>GameScene</code>, and this block is located in <code>didMoveToView</code></p>

<pre><code>    //Ship animation
    let shipAnimatedAtlas = SKTextureAtlas(named: "ShipImages")
    var blinkFrames = [SKTexture]()

    let numImages = shipAnimatedAtlas.textureNames.count
    for var i=1; i&lt;=numImages; i += 1 {
        let shipTextureName = "samShip\(i).png"
        blinkFrames.append(shipAnimatedAtlas.textureNamed(shipTextureName))
    }

    shipAnimationFrames = blinkFrames
</code></pre>

<p>Any help would be awesome!</p>