title: Swift UIPanGestureRecognizer right to left only
body: <p>I'm building a slide out menu using a tutorial from Ray Wenderlich and can't figure out how to disable left to right panning but keep right to left? I remove addLeftPanelViewController() but it still shows the pan, just not working correctly. I don't want anything to move, or unhide on the left to right.</p>
  
  <p>Thanks for any help.</p>
  
  <pre><code>override func viewDidLoad() {
      let panGestureRecognizer = UIPanGestureRecognizer(target: self, action: "handlePanGesture:")
              centerNavigationController.view.addGestureRecognizer(panGestureRecognizer)
  }
  
  
  
  let gestureIsDraggingFromLeftToRight = (recognizer.velocityInView(view).x &gt; 0)
   
  switch(recognizer.state) {
    case .Began:
      if (currentState == .BothCollapsed) {
        if (gestureIsDraggingFromLeftToRight) {
          addLeftPanelViewController()
        } else {
          addRightPanelViewController()
        }
   
        showShadowForCenterViewController(true)
      }
    case .Changed:
      recognizer.view!.center.x = recognizer.view!.center.x + recognizer.translationInView(view).x
      recognizer.setTranslation(CGPointZero, inView: view)
    case .Ended:
      if (leftViewController != nil) {
        // animate the side panel open or closed based on whether the view has moved more or less than halfway
        let hasMovedGreaterThanHalfway = recognizer.view!.center.x &gt; view.bounds.size.width
        animateLeftPanel(shouldExpand: hasMovedGreaterThanHalfway)
      } else if (rightViewController != nil) {
        let hasMovedGreaterThanHalfway = recognizer.view!.center.x &lt; 0
        animateRightPanel(shouldExpand: hasMovedGreaterThanHalfway)
      }
    default:
      break
  }
  </code></pre>