recruit-mp / RMPZoomTransitionAnimator

A custom zooming transition animation for UIViewController
MIT License
1.71k stars 178 forks source link

Add support for UIViewControllerInteractiveTransitioning #1

Open mpon opened 9 years ago

mpon commented 9 years ago

If you use this animator in navigation controller animations, it will be disable to use edge swipe gesture to pop a navigation controller.

You can avoid that temporarily like a below code.


- (void)viewDidLoad
{
    [super viewDidLoad];
    // receive interactivePopGestureRecognizer delegate from your UINavigationController
    self.navigationController.interactivePopGestureRecognizer.delegate = self;
}

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
    // remember swiping here
    return YES;
}

- (id <UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController
                                   animationControllerForOperation:(UINavigationControllerOperation)operation
                                                fromViewController:(UIViewController *)fromVC
                                                  toViewController:(UIViewController *)toVC
{
    if (/* if edge swiping */) {
        return nil;
    }
    return animator;
}
syrakozz commented 9 years ago

+1

xietao3 commented 9 years ago

good job