Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 584
sirvine Avatar asked Dec 21 '13 01:12

sirvine


1 Answers

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.

like image 199
Arek Holko Avatar answered Oct 21 '22 22:10

Arek Holko