title: Moving UIView within Parent UIView (UIPanGestureRecognizer)
body: <p>I am using the following code to move a UIImageView that is present inside of a UIView. </p>
  
  <pre><code>- (IBAction)handlePan:(UIPanGestureRecognizer *)recognizer {
  
  CGPoint translation = [recognizer translationInView:self.view];
  recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x,
                                       recognizer.view.center.y + translation.y);
  [recognizer setTranslation:CGPointMake(0, 0) inView:self.view];
  </code></pre>
  
  <p>}</p>
  
  <p>I would like to make it so that the UIView does not move outside of the parent view. At the minute the image view is able to move across the entire screen.</p>