title: Disabling UIPanGestureRecognizer of UITableView programmatically
body: <p>In my <code>UIViewController</code> I have a <code>UITableViewController</code> (filling up the whole screen) and a <code>UIScreenEdgePanGestureRecognizer</code>. I want to disable the <code>UIPanGestureRecognizer</code> of the table when the user is panning at the edge of the screen.</p>
  
  <p>I can solve this problem by using <code>shouldRecognizeSimultaneouslyWithGestureRecognizer</code> but it just doesn't feel right being able to pan the table vertically and activating the <code>UIScreenEdgePanGestureRecognizer</code>.</p>
  
  <p>So I was trying to set the delegate of the <code>UIPanGestureRecognizer</code> of the table to self and disable it when a <code>UIScreenEdgePanGestureRecognizer</code> is occurring by using:</p>
  
  <pre><code>if let recognizers = tableView.gestureRecognizers {
      if let index = find(recognizers.map { $0 is UIPanGestureRecognizer }, true) {
          (recognizers[index] as UIPanGestureRecognizer).delegate = self
      }
  }
  </code></pre>
  
  <p>This is giving me an exception saying: <code>'UIScrollView's built-in pan gesture recognizer must have its scroll view as its delegate.'</code></p>
  
  <p>Is there another way to disable the <code>UIPanGestureRecognizer</code> of the table?</p>