Hi,
In the latest beta (Xcode 12 beta 4) we started noticing that calling setViewControllers on UINavigationController no longer replaces the navigation stack, but instead pushes the replacement view controllers.
e.g.
In Xcode 12 beta 4 it appears the final result (e.g. inspecting navigationController.viewControllers) yields:
[originalViewController, replacementViewController] in the navigation stack
The expectation is the final result would be:
[replacementViewController] in the navigation stack
Note:
Thanks!
In the latest beta (Xcode 12 beta 4) we started noticing that calling setViewControllers on UINavigationController no longer replaces the navigation stack, but instead pushes the replacement view controllers.
e.g.
Code Block swift let navigationController = UINavigationController(rootViewController: originalViewController) navigationController.setViewControllers([replacementViewController], animated: true)
In Xcode 12 beta 4 it appears the final result (e.g. inspecting navigationController.viewControllers) yields:
[originalViewController, replacementViewController] in the navigation stack
The expectation is the final result would be:
[replacementViewController] in the navigation stack
Note:
This appears to only occur when animated, when using animated: false the behavior works as expected (view controllers get replaced)
Thanks!