title: How to programmatically send a pangesture in swift
body: <p>I have a view that has panGesture functionality, but I need to send a pan-gesture from one point to another programatically. Is there a way to do this in swift using an animation with a specific time interval? Here is my attempt at calling the pan gesture programmatically:</p>
  <pre><code>    var upPanPoint = CGPoint(x: contentView.center.x, y: contentView.center.y + 500)
      var upPan = panGestureRecognizer.setTranslation(upPanPoint, inView: self)
      
      onSwipe(upPan)
  </code></pre>
  <p>here is the code that recognizes the pan gesture:</p>
  <pre><code> func onSwipe(panGestureRecognizer : UIPanGestureRecognizer!) {
      let view = panGestureRecognizer.view!
      print(view)
      
      switch (panGestureRecognizer.state) {
      case UIGestureRecognizerState.Began:
          if (panGestureRecognizer.locationInView(view).y &lt; view.center.y) {
              self.viewState.rotationDirection = .RotationAwayFromCenter
          } else {
              self.viewState.rotationDirection = .RotationTowardsCenter
          }
      case UIGestureRecognizerState.Ended:
          self.finalizePosition()
      default:
          let translation : CGPoint = panGestureRecognizer.translationInView(view)
          view.center = self.viewState.originalCenter + translation
          self.rotateForTranslation(translation, withRotationDirection: self.viewState.rotationDirection)
          self.executeOnPanForTranslation(translation)
      }
  }
  </code></pre>