Skip to content

Commit e930aee

Browse files
authored
Fix another iOS 17.1 animation bug (#113)
1 parent 651adee commit e930aee

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Sources/NavigationTransitions/NavigationTransition+UIKit.swift

+14
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ extension UINavigationController {
145145
customDelegate.transition = transition
146146
}
147147

148+
swizzle(
149+
UINavigationController.self,
150+
#selector(UINavigationController.setViewControllers),
151+
#selector(UINavigationController.setViewControllers_animateIfNeeded)
152+
)
153+
148154
swizzle(
149155
UINavigationController.self,
150156
#selector(UINavigationController.pushViewController),
@@ -232,6 +238,14 @@ extension UINavigationController {
232238
}
233239

234240
extension UINavigationController {
241+
@objc private func setViewControllers_animateIfNeeded(_ viewControllers: [UIViewController], animated: Bool) {
242+
if let transitionDelegate = customDelegate {
243+
setViewControllers_animateIfNeeded(viewControllers, animated: transitionDelegate.transition.animation != nil)
244+
} else {
245+
setViewControllers_animateIfNeeded(viewControllers, animated: animated)
246+
}
247+
}
248+
235249
@objc private func pushViewController_animateIfNeeded(_ viewController: UIViewController, animated: Bool) {
236250
if let transitionDelegate = customDelegate {
237251
pushViewController_animateIfNeeded(viewController, animated: transitionDelegate.transition.animation != nil)

0 commit comments

Comments
 (0)