将默认的interactivePopGestureRecognizer扩展到屏幕边缘以外?

将默认的interactivePopGestureRecognizer扩展到屏幕边缘以外?

问题描述:

我有一个 UIViewController 被推送到导航堆栈。我想扩展标准的iOS7交互式平移手势,将此视图控制器弹出超出默认 UIRectEdgeLeft 边界,以便用户可以通过从任何位置进行平移来启动交互式后退操作风景。

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.

我已尝试滚动自己的交互式视图控制器转换,但要完全复制默认 interactivePopGestureRecognizer的良好视差处理是很麻烦的。例如, fromViewController 隐藏导航栏,而 toViewController 显示它 - 这是一个不容易处理的东西自定义交互式转换,但在默认操作中是无缝的。

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.

因此,我想将默认操作扩展到更大的平移手势区域,但是API似乎不支持简单地替换手势。

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.

任何有创意的建议?

查看我的图书馆 SloppySwiper ,使用 UIPanGestureRecognizer实现此目的并重新创建默认动画。您还可以在 https://github.com/fastred/SloppySwiper/issues/1 。

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.