UInavigationBarの戻るボタンをカスタムしつつ、スワイプで戻れるようにするには、以下のようにします。
戻るボタンをカスタムする
@interface HogeViewController ()
@property(nonatomic,weak) id orgDelegate;
@end
@implementation HogeViewController
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
if([[self.navigationController viewControllers] count] > 1){
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"NavigationLeftAllow"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(actionPopViewController)];
[self.navigationItem.leftBarButtonItem setBackgroundImage:[UIImage new]
forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
self.orgDelegate = self.navigationController.interactivePopGestureRecognizer.delegate;
self.navigationController.interactivePopGestureRecognizer.delegate = self;
}
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
self.navigationController.interactivePopGestureRecognizer.delegate = self.orgDelegate;
}
- (void)actionPopViewController
{
[self.navigationController popViewControllerAnimated:YES];
}
スワイプのジェスチャーを受け取る部分の実装は微妙ですが、とりあえずこれで動作すると思います。