3

As in the title, if I remove an action using sprite.removeAllActions(), does the action's completion still get run?

Here is a basic code snippet to help show what I am asking:

import SpriteKit

/// The action to add
let action = SKAction.moveBy(x: 10, y: 20, duration: 1.0)

/// The sprite to apply the action to
let sprite = SKSpriteNode(color: .white, size: CGSize(width: 50, height: 50))

// Run the action
sprite.run(action) {
    // Completion
    print("Completion")
}
George
  • 25,988
  • 10
  • 79
  • 133

1 Answers1

4

I just quickly tested it after not receiving an answer. I discovered that the completion does NOT run if the action has been removed.

George
  • 25,988
  • 10
  • 79
  • 133