title: detect the sprite from two points ( cgpoint ) sprite kit - swift
body: <p>I'm making a game in SpriteKit .
  I have a huge problem, I can not find online and even on the Apple website the method to be able to find a node between two locations ( CGPoint ) .
  The method UiSwipeGesture you can not find the Swipe in any direction but only left, right, up, down .</p>
  
  <p>So I found other methods (see code below ) to make a slide , but I can not find the way to understand there is some node between the two positions.</p>
  
  <p>Someone can help me? thanks</p>
  
  <p>Code here:</p>
  
  <pre><code>var locationBegan : CGPoint = CGPoint()
  var locationEnded : CGPoint = CGPoint()
  var objectbegan : SKNode = SKNode()    
  
  override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {
      for touch: AnyObject in touches 
      {
          let location: CGPoint! = touch.locationInNode(self)
          self.locationBegan = location
          var nodeAtPoint : SKNode = self.nodeAtPoint(location)
          self.objectbegan = nodeAtPoint
  
      }
  }
  
  override func touchesEnded(touches: NSSet, withEvent event: UIEvent) {
      for touch: AnyObject in touches {
          let location: CGPoint! = touch.locationInNode(self)
          self.locationEnded = location
          var nodeAtPoint : SKNode = self.nodeAtPoint(location)
  
          var finalDestination : CGPoint = GetFinalDestination(location, nodeAtPoint: self.objectbegan)
          nodeAtPoint.runAction(SKAction.moveTo(finalDestination, duration: 1))
  
      }
  }
  </code></pre>
  
  <p>how find the node between locationBegan and locationEnded ?
  Thanks</p>
  
  <p>If this is not possible could you advise me a method to find the node in the swipe in all directions , not just left, right , up and down ? thanks</p>
  
  <p><strong>UPDATE</strong>
  Set the node this properties for run:</p>
  
  <pre><code>node.physicsBody = SKPhysicsBody(circleOfRadius: 5)
  node.physicsBody?.dynamic = false
  </code></pre>