title: iOS: recognize pinch gestures but not two finger pans?
body: <p>The goal is to only let pinch gestures get recognized if a two-finger pan is not in process.</p>
  
  <p>This code allows both <code>pinchGesture</code> and two-finger <code>panGestures</code>, but they occur at the same time. This was based off <a href="https://stackoverflow.com/questions/30829973/simultaneous-gesture-recognition-for-specific-gestures">this answer</a> to use the <code>gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer: UIGestureRecognizer)</code> function.</p>
  
  <pre><code>    // Handle two-finger pans
      let twoFingerPanRecognizer = UIPanGestureRecognizer(target: self, action: #selector(sceneViewPannedTwoFingers))
      twoFingerPanRecognizer.minimumNumberOfTouches = 2
      twoFingerPanRecognizer.maximumNumberOfTouches = 2
      twoFingerPanRecognizer.delegate = self
      sceneView.addGestureRecognizer(twoFingerPanRecognizer)
  
      // Handle pinches
      let pinchGesture = UIPinchGestureRecognizer(target: self, action: #selector(sceneViewPinched))
      pinchGesture.delegate = self
      sceneView.addGestureRecognizer(pinchGesture)
  
      func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer: UIGestureRecognizer) -&gt; Bool {
         if gestureRecognizer is UIPinchGestureRecognizer {
            return false
         } else {
            return true
         }
       }
  </code></pre>
  
  <p>This code allows two-finger pans, but pinches do not work at all.</p>
  
  <pre><code>    // Handle two-finger pans
      let twoFingerPanRecognizer = UIPanGestureRecognizer(target: self, action: #selector(sceneViewPannedTwoFingers))
      twoFingerPanRecognizer.minimumNumberOfTouches = 2
      twoFingerPanRecognizer.maximumNumberOfTouches = 2
      twoFingerPanRecognizer.delegate = self
      sceneView.addGestureRecognizer(twoFingerPanRecognizer)
  
      // Handle taps
      let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(sceneViewTapped))
      sceneView.addGestureRecognizer(tapRecognizer)
  
      // Handle pinches
      let pinchGesture = UIPinchGestureRecognizer(target: self, action: #selector(sceneViewPinched))
      pinchGesture.delegate = self
      pinchGesture.requireGestureRecognizerToFail(twoFingerPanRecognizer)
      sceneView.addGestureRecognizer(pinchGesture)
  
      func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer: UIGestureRecognizer) -&gt; Bool {
         return true
      }
  </code></pre>