title: How to limit the number of touches in touchesBegan in swift Spritekit
body: <p>I have written a location finder for touch points in my touchesBegan function, I want to limit the number of touch points allowed in the view controller to 2 but I don't quite know how to do that. A little help would be fantastic.</p>
  
  <pre><code>  override func touchesBegan(touches: Set&lt;UITouch&gt;, withEvent event: UIEvent?) {
     for touch: AnyObject in touches {
      let location = touch.locationInNode(self)
  
  
      Object.physicsBody?.affectedByGravity = true
      Object2.physicsBody?.affectedByGravity = true
      Object3.physicsBody?.affectedByGravity = true
  
  
      if Object.containsPoint(location) {
    Object.physicsBody?.velocity = CGVectorMake(0, 0)
      Object.physicsBody?.applyImpulse(CGVector(dx: 0, dy: 135))
  
  }
  
          if Object2.containsPoint(location) {
             Object2.physicsBody?.velocity = CGVectorMake(0, 0)
              Object2.physicsBody?.applyImpulse(CGVector(dx: 0, dy: 135))
   }
  
  
          if Object3.containsPoint(location) {
              Object3.physicsBody?.velocity = CGVectorMake(0, 0)
              Object3.physicsBody?.applyImpulse(CGVector(dx: 0, dy: 135))
  
  
  
      }
  
      }
  
  
          }
  </code></pre>