title: Navigating UIViewControllers with gestures in iOS
body: <p>I have several view controllers embedded in a UINavigationController (some modal, some pushed) and am navigating through them using swipe gestures as such:</p>
  
  <pre><code>// Gesture recognizers
  UISwipeGestureRecognizer *downGesture = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(dismissButton)];
  downGesture.direction = UISwipeGestureRecognizerDirectionDown;
  [downGesture setCancelsTouchesInView:NO];
  [self.view addGestureRecognizer:downGesture];
  </code></pre>
  
  <p>This works fine, however I want the user to be able to <em>physically drag</em> the modally presented view controller, for example, down and off the screen instead of just a flick and an animation doing the rest, or dragging right across the screen and snapping to the previous view instead of tapping the back button. </p>
  
  <p>I've tried implementing this using a pan gesture on the view but of course the previous view controller isn't visible behind it, which it needs to be. How is this effect achieved properly? With view controller containment? If so how would that work when pushing a few view controllers on to the stack? An example of the type of navigation I'm talking about can be found in the LetterPress app. </p>
  
  <p>thanks.</p>