title: Swift Spritekit Scrolling Background
body: <p>I am trying to find the best method to do a vertically scrolling background in Swift,
  without using the Update Method. The Background is 1 Image that should loop infinite.
  The Image should be in the middle of the screen (full-size), moving down, and on top of that image should always be another image spawned.</p>
  
  <p>However, mine doesn't work quite right, it spawns 2 images, and than after a delay they pop up and start the Actions again.
  Also, it breaks sometimes down from 30 FPS to 26, which I want to avoid.
  I hope somebody, who is more into Swift can help me.</p>
  
  <pre><code>let Background = SKTexture(imageNamed: "Background.png")
      Background.filteringMode = .Nearest
  
      let BackgroundMove = SKAction.moveByX(0, y: -self.frame.size.height, duration: 10)
      let BackgroundReset = SKAction.moveByX(0, y: self.frame.size.height, duration: 0.0)
      let BackgroundMoveAndResetForever = SKAction.repeatActionForever(SKAction.sequence([BackgroundMove,BackgroundReset]))
  
      for var i:CGFloat = 0; i &lt; 2.0 + self.frame.size.height / (Background.size().height * 2); ++i {
          let sprite = SKSpriteNode(texture: Background)
          sprite.size = CGSize(width: self.frame.size.width / 2, height: self.frame.size.height)
          sprite.position = CGPointMake(self.frame.size.width / 2, self.frame.size.height / 2 * i)
          sprite.zPosition = 1
          sprite.runAction(BackgroundMoveAndResetForever)
          self.addChild(sprite)
      }
  </code></pre>