Am I missing the obvious? So even after removeFromParent sprite is still around. However, this may be due to the fact that I assigned the node temporary variable SKSpriteNode , then, while this variable is around, there is a strong link to node, so it will not be released. Also, the SKPhysicsContact object SKPhysicsContact keep a reference to a physical element that references a node, which I think will also prevent selection.
Update
To see when the sprite is actually released, use the deinit() method:
deinit { print("Invader of type \(type) deinitialised") }
I think this can only be added to the definition of a subclass, not through an extension.
Having a variable with a strong reference to the node to be deleted will prevent node allocation until the variable itself is deleted or modified to refer to something else.
source share