只需要在你自定义的导航控制器中,改成如下代码即可,自定义手势返回

*/
#define KEY_WINDOW [[UIApplication sharedApplication] keyWindow]
#define kScreenW KEY_WINDOW.bounds.size.width
#define kAnimateDuration 0.3
 
#define kDefaultAlapa 0.5
#define kDefaultScale 0.95
 
#define iOS7 ([UIDevice currentDevice].systemVersion.floatValue >= 7.0)
 
#import "CXNavigationController.h"
#import <QuartzCore/QuartzCore.h>
 
@interfaceCXNavigationController ()
{
NSMutableArray *_images; //图片数组
UIView *_bgView; //背景图
UIView *_blankMask; //面罩
UIImageView *_imageView; //图像
CGPoint _startPoint; //开始接触点
}
@end
 
@implementation
 
- (void)viewDidLoad{
    [superviewDidLoad];
    _images = [NSMutableArrayarray];
if (!iOS7) {
        UIPanGestureRecognizer *pan = [[UIPanGestureRecognizeralloc] initWithTarget:selfaction:@selector(panMove:)];
        [self.viewaddGestureRecognizer:pan];
    }
}
 
- (void)panMove:(UIPanGestureRecognizer *)pan{
if (self.viewControllers.count <= 1) {
return;
    }
CGRect selfF = self.view.frame;
CGPoint location = [pan locationInView:KEY_WINDOW];
    if (pan.state == UIGestureRecognizerStateBegan) { //开始拖拽
_startPoint
        _imageView.image = [_imageslastObject];
        [KEY_WINDOWinsertSubview:_bgViewbelowSubview:self.tabBarController.view];
        _imageView.transform = CGAffineTransformMakeScale(kDefaultScale, kDefaultScale);
    }elseif(pan.state == UIGestureRecognizerStateChanged){ //拖拽中
        
CGFloat marginX = location.x - _startPoint.x;
kScreenW ? kScreenW
0 ? 0
origin.x
self.view.frame
        
CGFloat scale = kDefaultScale + marginX * 1.0 / 6400;
kScreenW ? 0.5
0 ? 0
_imageView.transform = CGAffineTransformMakeScale(scale, scale);
        
CGFloat alpha = kDefaultAlapa - (1 - kDefaultAlapa) * marginX * 1.0 / kScreenW;
kScreenW ? kDefaultAlapa
0 ? 0
_blankMask.alpha
        
    }elseif(pan.state == UIGestureRecognizerStateEnded){ //结束
CGFloat marginX = location.x - _startPoint.x;
if (marginX > 50) {
kScreenW ? kScreenW
CGFloat dur = kAnimateDuration - marginX * 1.0 / 2000;
            [UIViewanimateWithDuration:dur animations:^{
CGRect selfF = self.view.frame;
origin.x = KEY_WINDOW.bounds.size.width;
self.view.frame
_blankMask.alpha = 0;
                _imageView.transform = CGAffineTransformMakeScale(1, 1);
completion:^(BOOL
_images removeLastObject];
_bgView removeFromSuperview];
CGRect rect = self.view.frame;
origin.x = 0;
self.view.frame
                [superpopViewControllerAnimated:NO];
            }];
else{
CGFloat marginX = location.x - _startPoint.x;
50 ? 50
0 ? 0
CGFloat dur = marginX * 1.0 / 500;
            [UIViewanimateWithDuration:0.1 + dur  animations:^{
CGRect selfF = self.view.frame;
origin.x = 0;
self.view.frame
            }];
        }
    }
}
 
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    if (self.viewControllers.count > 0) {
if (!iOS7) {
self createBg];
        }
    }
super pushViewController:viewController animated:animated];
}
 
#pragma mark 创建背景
- (void)createBg{
    [_imagesaddObject:[selfcurrentScreenImage]];
if (!_bgView) {
_bgView = [[UIView alloc] initWithFrame:KEY_WINDOW.bounds];
        _bgView.backgroundColor = [UIColorblackColor];
        
_imageView = [[UIImageView alloc] initWithFrame:KEY_WINDOW.bounds];
        _imageView.backgroundColor = [UIColorclearColor];
        [_bgViewaddSubview:_imageView];
        
_blankMask = [[UIView alloc] initWithFrame:KEY_WINDOW.bounds];
        _blankMask.backgroundColor = [UIColorblackColor];
_blankMask.alpha = kDefaultAlapa;
        [_bgViewaddSubview:_blankMask];
    }
}
 
#pragma mark 获取当期屏幕
- (UIImage
    UIGraphicsBeginImageContextWithOptions(KEY_WINDOW.bounds.size, self.view.opaque, 0.0);
    if (self.topViewController.tabBarController) {
        [self.topViewController.tabBarController.view.layerrenderInContext:UIGraphicsGetCurrentContext()];
else{
        [self.view.layerrenderInContext:UIGraphicsGetCurrentContext()];
    }
    UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
return
}