title: iOS: Draggable UIView (vertically only)
body: <p>In my app I have a small subview that I'd like to tether in the bottom right corner and allow to be moved only vertically for a fixed distance. </p>
  
  <p>I have some code to allow it to be dragged, but no further constraints:</p>
  
  <pre><code>- (void)viewDragged:(UIPanGestureRecognizer *)gesture
  {
      CGPoint translation = [gesture translationInView:keyView];
  
      // move view
      keyView.center = CGPointMake(keyView.center.x + translation.x,
                             keyView.center.y + translation.y);
  // reset translation
  [gesture setTranslation:CGPointZero inView:keyView];
  }
  </code></pre>
  
  <p>I've looked around on StackOverflow and tried a couple of ways, but the only one that worked didn't take into account diagonal movement, and I couldn't find anything in regards to tethering it to one spot.</p>
  
  <p>So does anyone know how this can be done? Many thanks</p>
  
  <p>EDIT: Also, does anyone know of a good, informative reference doc (other than the Apple one) for topics of this nature? </p>