1
votes

The default interactivePopGestureRecognizer only works if you swipe left to right on the left edge of the screen. I would like to be able to perform this gesture by swiping anywhere on my screen. Apps like Reddit, Slack and Twitter have implemented this gesture, so I know it is possible.

So far, I have successfully popped to the previous VC using a swipe gesture self.navigationController.popViewControllerAnimated(true), however it does not show the top stack during the swipe. This action performs an immediate and quick animated transition to the other stack. I would like the animation to be similar to the default and slowly "peel away" the stack as the finger is dragged across the screen. This leads me to believe that it is possible to do this with a pan Gesture, however I am unsure how to slowly move the current view controller out of the frame and reveal the next stack during translation.

EDIT: SOLUTION

Here is the solution: https://stackoverflow.com/a/35510861/9159691

1
Try this SloppySwiping animator github.com/jaredsinclair/JTSSloppySwipingAbdelahad Darwish
@AbdelahadDarwish here is the solution: stackoverflow.com/a/35510861/9159691John Davis

1 Answers

0
votes

I think this is easier than the suggested solution and also works for all viewControllers inside that navigation and also for nested scrollviews.

https://stackoverflow.com/a/58779146/8517882

Just install the pod and then use EZNavigationController instead of UINavigationController to have this behavior on all view controllers inside that navigation controller.