如何为 UINavigationController 启用全屏 Pan back

How to enable full screen Pan back for UINavigationController

来自iOS7 apple 提供了向后平移UINavigationController 的方法,但只能通过从屏幕边缘滑动来完成。如何启用全屏向后平移手势?

我真的花了很多时间试图解决这个问题,终于找到了方法。我只是问一个问题,然后自己回答,在这里分享解决方案。

请参考我的博客以获取更多详细信息enter link description here

演示代码:

#import "TestNavigationController.h"

@interface _UINavigationInteractiveTransition

@end

@interface UINavigationController(Custom)
@property (strong, nonatomic) _UINavigationInteractiveTransition * _cachedInteractionController;

@end

@implementation TestNavigationController
{
    UIPanGestureRecognizer *_p;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    NSLog(@"%@", self.interactivePopGestureRecognizer
          );
    _p = [[UIPanGestureRecognizer alloc]initWithTarget:self._cachedInteractionController action:@selector(handleNavigationTransition:)];
    NSLog(@"%@", self._cachedInteractionController);
    [self.view addGestureRecognizer:_p];
   } 
@end

编辑说明: 这会公开私有 API。