title: Xcode SpriteKit - Removing Sprites and stopping an action - repeatActionForever
body: <p>I am new to Swift and SpritKit and having a few issues with my game.</p>
  
  <p>In my <code>didMoveToView(view: SKView) { }</code> section of my code I call the below statement which populates monsters on the screen. In my <code>func addMonster() { }</code> 
  The monsters then animated to move from the right hand side, to the left hand side of the screen. Once they are off the screen the opposite side, the sprite gets removed.</p>
  
  <p>CODE A</p>
  
  <pre><code>    runAction(SKAction.repeatActionForever(
          SKAction.sequence([
              SKAction.runBlock(addMonster),
              SKAction.waitForDuration(1.0),SKAction.
              ])
          ))
  </code></pre>
  
  <p>In the add Mons†er function, i call the following code which moves the Monster across the screen.</p>
  
  <pre><code>    let actualDuration = random(min: CGFloat(6.0), max: CGFloat(10.0))
      let actionMove = SKAction.moveTo(CGPoint(x: -monster.size.width/2, y: actualY), duration: NSTimeInterval(actualDuration))
      let actionMoveDone = SKAction.removeFromParent()
      monster.runAction(SKAction.sequence([actionMove, actionMoveDone]))
  </code></pre>
  
  <p>All of the code above is working fine.</p>
  
  <p>When the user has killed an X amount of monsters, I want all the other monsters of the screen to disappear and stop spawning.</p>
  
  <p>My questions are, how do I a) Stop CODE A from spawning monsters and b) how do I get any monsters that are on the view, the be removed?</p>
  
  <p>Thanks,</p>
  
  <p>Ryann</p>