interactivePopGestureRecognizer stops working when UINavigationController's delegate is set. Why?

In my code, one of the view controllers in the navigation controller's stack is setting itself as the delegate of

navigationController
in its viewDidLoad. I am doing this to provide a custom animator for the push operation. I am providing implementation only for
navigationController(_:animationControllerFor:from:to:)
and nothing else.

I also ensured that I am not missing any calls to

super
in any of the overridden methods.


But the side effect of this is that the interactive pop gesture has stopped working i.e. when I perform the gesture nothing happens.

On digging deeper, I found that this is being caused by the delegate of the

interactivePopGestureRecognizer
. This delegate is system provided. I am not setting this anywhere in my code.


What I found was that when I am setting the delegate of the

navigationController
, the delegate of the
interactivePopGestureRecognizer
is blocking the gesture by returning false for
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool
.


I want to know why is this behavior happening.


Do I have to do something else to make it work? By this I mean to make it work properly i.e. the system provided delegate for

interactivePopGestureRecognizer
allows the gestures. Not by writing a workaround code.


I have also gone through Apple's documentation for UINavigationController but found nothing which can explain this issue.

It's pretty annoying. If the navigation controller delegate at any point (it seems) provides a custom animator (in my case for popping) it breaks the interactive pop gesture.


Only workaround I have to install a *temporary* delegate object that implements the transition then reset the delegate back to an object that does not implement the optional -navigationController:animationControllerForOperation:fromViewController:toViewController: when the custom transition completes.

interactivePopGestureRecognizer stops working when UINavigationController's delegate is set. Why?
 
 
Q