title: how to detect touch on node
body: <p>I have an app thats spawn ball on the screen every 1 second. now, I want the user to touch those balls what make them disappear (removeFromParent()). as I understand I have to set the touch function via touchesBegan and I do so, here is my code:</p>
  
  <pre><code>    override func touchesBegan(_ touches: Set&lt;UITouch&gt;, with event: UIEvent?) {
      for touch: AnyObject in touches{
          let positionOfTouch = touch.location(in: self)
          enumerateChildNodes(withName: "BALL") { (node: SKNode, nil) in
              if positionOfTouch == node.position {
                  print("just touched the ball")
              }
              else{
                  print("error")
              }
          }
      }
  </code></pre>
  
  <p>the problem is that when I touch the screen/ ball the console print <strong>error</strong> instead of <strong>just touched the ball</strong>, which mean that my code doesn't work. moreover, the console print the error message as the number of the balls in my view. i don't relay understand what I am doing wrong and how to really set this function. 
  here is my createBall function which implement from my BallNode class (type SKShapeNode):</p>
  
  <pre><code>    func createBall(){
      let ball = BallNode(radius: 65)
      print(ball.Name)
      print(ball._subName!)
  
      ball.position.y = ((frame.size.height) - 200)
      let ballXPosition = arc4random_uniform(UInt32(frame.size.width)) // set the ball a randon position from the top of the screen
      ball.position.x = CGFloat(ballXPosition)
  
      ball.physicsBody?.categoryBitMask = PhysicsCategory.ball // ball's category bitMask
      ball.physicsBody?.collisionBitMask = PhysicsCategory.ball // prevent objects from intersecting
      ball.physicsBody?.contactTestBitMask = PhysicsCategory.topBorder // when need to know if two objects touch each other
  
      addChild(ball)
  
  }
  </code></pre>
  
  <p>can you help me with that? because I am quit new for swift I also would like  to get some explanation about this touch detection (and touches in general - the apple doc is poor). </p>