Search code examples
iosobjective-cios7

Extend default interactivePopGestureRecognizer beyond screen edge?


I have a UIViewController that gets pushed onto a navigation stack. I'd like to extend the standard iOS7 interactive pan gesture to pop this view controller beyond the default UIRectEdgeLeft boundaries, so that users can initiate an interactive back action by panning from anywhere on the view.

I've tried rolling my own interactive view controller transition, but it's a lot of hassle to fully replicate the nice parallax handling of the default interactivePopGestureRecognizer. For example, the fromViewController hides the navigation bar, while the toViewController shows it—something that is not easy to handle in a custom interactive transition, but is seamless in the default action.

As a result, I want to extend the default action to a larger area of pan gesture, but the API doesn't seem to support simply replacing the gesture.

Any creative suggestions?


Solution

  • Check out my library SloppySwiper, which achieves this by using UIPanGestureRecognizer and by recreating the default animation. You can also see my ideas in https://github.com/fastred/SloppySwiper/issues/1.