0

I've got a custom navigation controller declared as below. My problem is that once I implement this, the back swipe gesture to go back to previous stack (interactivepopgesturerecognizer) is not working. How can I enable it back? I've got a lot of view controller in my app. Thank You.

    #import "NavController.h"

    @interface NavController ()
    {
        BOOL shouldIgnorePushingViewControllers;
    }

    @end

    @implementation NavController

    -(instancetype)init {
        self = [super init];
        self.delegate=self;

        return self;

    }

    -(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
    {
        if (!shouldIgnorePushingViewControllers)
        {
            [super pushViewController:viewController animated:animated];
        }

        shouldIgnorePushingViewControllers = YES;
    }

    - (void)didShowViewController:(UIViewController *)viewController animated:(BOOL)animated
    {
        shouldIgnorePushingViewControllers = NO;
    }

    @end
da32
  • 703
  • 1
  • 9
  • 18

1 Answers1

0

Try to enable property

self.interactivePopGestureRecognizer.enabled = YES;

to init method

iSashok
  • 2,326
  • 13
  • 21