diff --git a/Sources/NavigationTransitions/NavigationTransition+UIKit.swift b/Sources/NavigationTransitions/NavigationTransition+UIKit.swift index fe95c5f7..11b210c0 100644 --- a/Sources/NavigationTransitions/NavigationTransition+UIKit.swift +++ b/Sources/NavigationTransitions/NavigationTransition+UIKit.swift @@ -145,6 +145,12 @@ extension UINavigationController { customDelegate.transition = transition } + swizzle( + UINavigationController.self, + #selector(UINavigationController.setViewControllers), + #selector(UINavigationController.setViewControllers_animateIfNeeded) + ) + swizzle( UINavigationController.self, #selector(UINavigationController.pushViewController), @@ -232,6 +238,14 @@ extension UINavigationController { } extension UINavigationController { + @objc private func setViewControllers_animateIfNeeded(_ viewControllers: [UIViewController], animated: Bool) { + if let transitionDelegate = customDelegate { + setViewControllers_animateIfNeeded(viewControllers, animated: transitionDelegate.transition.animation != nil) + } else { + setViewControllers_animateIfNeeded(viewControllers, animated: animated) + } + } + @objc private func pushViewController_animateIfNeeded(_ viewController: UIViewController, animated: Bool) { if let transitionDelegate = customDelegate { pushViewController_animateIfNeeded(viewController, animated: transitionDelegate.transition.animation != nil)