title: Swift: UIPanGestureRecognizer bug swipe reverse
body: <p>I've created an <code>UIPanGestureRecognizer</code> but the problem is that when I slide the view to the right the view goes to the left.</p>
  
  <p>When I slide the view to the left it goes to the right. Why?</p>
  
  <pre><code>let panGesture = UIPanGestureRecognizer(target: self, action: #selector(detectPan(recognizer:)))
  panGesture.delaysTouchesBegan = false
  panGesture.delaysTouchesEnded = false
  separatorView.addGestureRecognizer(panGesture)
  </code></pre>
  
  <p>and my function:</p>
  
  <pre><code>@objc func detectPan(recognizer: UIPanGestureRecognizer) {
      switch recognizer.state {
      case .began:
          self.startingConstant = self.centerConstraint.constant
      case .changed:
          let translation = recognizer.translation(in: self.view)
          self.centerConstraint.constant = self.startingConstant + translation.x
      default:
          break
      }
  }
  </code></pre>