title: Determining whether a point lies within the boundary of a physics body in Sprite Kit
body: <p>I'm using Sprite Kit to create a game involving balloons. The balloon image is a long rectangle (dotted line) but I've defined a physics body around the balloon itself using a polygon (solid line). I'd like players to be able to "pop" the balloon. I'm using the following block of code to achieve this:</p>
  
  <pre><code>- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
      UITouch *touch = [touches anyObject];
      NSArray *nodes = [self nodesAtPoint:[touch locationInNode:self]];
      for (SKNode *node in nodes) {
          [node removeFromParent];
          SKAction *pop = [SKAction playSoundFileNamed:@"pop.wav" waitForCompletion:NO];
          [self runAction:pop];
      }
  }
  </code></pre>
  
  <p>Unfortunately, when there are several balloons in the bunch, this method can result in a single tap popping multiple balloons. This is because the sprite images overlap (even though the physics bodies do not). There is also the undesired effect that a tap on the string will have the same effect as a tap on the balloon.</p>
  
  <p>I have access to the coordinates of the touch point, but is it even possible to detect whether a point lies within the area defined by the physics body (as opposed to the node)?</p>
  
  <p><img src="https://i.stack.imgur.com/eDqQU.png" alt="enter image description here"></p>