While I was working on a side project, I needed to customize the way modal view controllers are presented in iOS, with a nice animation and the ability to dismiss them interactively by dragging. So I created this library and open-sourced it on GitHub: ZFDragableModalTransition.

image

You can use it like this:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    TaskDetailViewController *detailViewController = segue.destinationViewController;
    detailViewController.task = sender;

    // create an animator object with the modal view controller instance
    // keep a strong reference in a property so it does not get released
    self.animator = [[ZFModalTransitionAnimator alloc] initWithModalViewController:detailViewController];
    self.animator.dragable = YES;
    self.animator.direction = ZFModalTransitonDirectionBottom;
    [self.animator setContentScrollView:detailViewController.scrollview];

    // set the transitioning delegate of the modal view controller to our animator
    detailViewController.transitioningDelegate = self.animator;
    detailViewController.modalPresentationStyle = UIModalPresentationCustom;
}