title: Is there any way to check if an SKSpriteNode has been removed from parent?
body: <p>I'm trying to check if this SKSpriteNode has been removed from the screen to implement a piece of code if it has but I can't seem to figure it out. </p>
  
  <p>My code; </p>
  
  <pre><code>if (player.position.y &gt; self.frame.size.height) {
      NSLog(@"out of frame");
      [self runAction:[SKAction sequence:@[
                                           [SKAction waitForDuration:0.5],
                                           [SKAction runBlock:^{
  
          levelMenu *mainMenu = [[levelMenu alloc] initWithSize:self.size];
          [self.view presentScene:mainMenu transition:[SKTransition fadeWithDuration:0.6]];
  
      }],
                                           ]]];
  }
  </code></pre>
  
  <p>But this isn't working.</p>
  
  <p><strong>Is there anything I could do to test for when it's been removed from the parent. I.e. something along the lines of "<code>If (player hasLeftScene)</code>or<code>(player hasBeenRemovedFromParent)</code>" or something?</strong></p>
  
  <p>I also tried testing for when the player.position.y > 568 (4-inch display) but it didn't work either. </p>