title: iOS Swift: UIPanGestureRecognizer in UIScrollView
body: <p>I have a <code>UIScrollView</code> that has 3 pages (which all contain a separate <code>UIContainerView</code> and onload starts at the second page (so that you can swipe left or right)</p>
  
  <p>I have added a <code>UIPanGestureRecogniser</code> to the second page (in the actual containerView controller) as I want to be able to track when the user swipe up or down on this page.</p>
  
  <p>I have got this working but by doing so it disables the scrollView from scrolling</p>
  
  <p>Heres my code:</p>
  
  <pre><code>let panRec = UIPanGestureRecognizer()
  
  @IBOutlet var containerView: UIView!      // (second page container view)
  
  override func viewDidLoad() {
  
      super.viewDidLoad()
  
      containerView.addGestureRecognizer(panRec)
  
      panRec.addTarget(self, action: "draggedView:")
  
  }
  
  func draggedView(sender:UIPanGestureRecognizer){
  
      var translation = sender.translationInView(self.view)
  
  
      if(translation.y &gt; 100)
      {
          NSNotificationCenter.defaultCenter().postNotificationName("showExtras", object:nil)
      }
  
      if(translation.y &lt; -100)
      {
          NSNotificationCenter.defaultCenter().postNotificationName("hideExtras", object:nil)
      }
  
  
  
  }
  </code></pre>
  
  <p>Hoping someone has a way I can scroll the scroll view but also use the pan gesture for vertical swiping?</p>
  
  <p>Any help would be much appreciated!</p>
  
  <p>Thanks,
  Dave</p>