title: Get 'Touch Drag Inside' Distance When Setting IBAction From Storyboard
body: <p>I know how to set UIPanGesture events and recognizers and get the data I need when I create them programatically.</p>
  
  <p>However I am trying to learn how to work with the storyboard and use IBOutlets.</p>
  
  <p>I have dragged over an IBAction for 'Touch Drag Inside'.</p>
  
  <pre><code>@IBAction func dragButtonDragEvent(sender: AnyObject)
      {
          println(sender)
      }
  </code></pre>
  
  <p>The problem is the sender object I get is just the button itself.</p>
  
  <p>Is there a way to get the drag distance or drag event data when using an IBAction?</p>
  
  <p>I tried </p>
  
  <pre><code>@IBAction func dragButtonDragEvent(sender: AnyObject)
      {
          var drag:UIPanGestureRecognizer = sender as UIPanGestureRecognizer
          println(drag.state)
      }
  </code></pre>
  
  <p>But I get a bad memory access error and the println is not executed as the sender is the button NOT the event.</p>
  
  <p>Can you suggest how to use Touch Drag Inside events when connecting from a Storyboard?</p>