Search code examples
iosswiftuinavigationcontroller

How to detect pop/push animation ended within a navigationController


I'm trying to implement a (like present/dismiss functions)

popViewControler:animated:compilation

pushViewController:animated:compilation

In a UINavigationController subclass.

I want to detect in my subclass every time a new UIViewController is poppet /pushed and the animation has ended and then call the callback.

Any suggestions?

Thanks


Solution

  • UINavigationControllerDelegate

    func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
    
    }
    
    func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
    
    }