Tab bar stays hidden after calling popToViewController(_:animated:)

Originator:iammartinmuller
Number:rdar://FB8542799 Date Originated:Aug 26, 2020
Status:Open Resolved:
Product:iOS/UIKit Product Version:14
Classification: Reproducible:
 
Hi, 

there seems to a discrepancy in the behaviour in an app compiled with Xcode 11 and 12 when calling `popToViewController(_:animated:)` on a navigation controller embedded in an `UITabBarController`. When we consecutively push two view controllers with `hidesBottomBarWhenPushed: true` and then call `popToViewController(_:animated:)` with the first view controller as an argument the app compiled with Xcode 11 will pop to the desired view controller and unhide the tab bar as expected, but the app compiled with Xcode 12 will pop to the desired view controller and keep the tab bar hidden. This issue is amplified by the new `UIMenu` history shown when long-pressing on the back button as `popToViewController(_:animated:)` seems to be called. I've attached sample project compilable in both Xcode 11 and 12.

Preconditions:
- Xcode 12
- `UINavigationController` with a root view controller, embedded in `UITabBarController`

Steps to reproduce:
1. Push a view controller with `hidesBottomBarWhenPushed: true`
2. Push another view controller with `hidesBottomBarWhenPushed: true`
3. Call `popToViewController(_:animated:)` on the navigation controller with the first (root view controller) as an argument or long-press on the back button and select the first (oldest) view controller

Expected:
The tab bar is unhidden

Actual:
The tab bar stays hidden

Thank you, stay safe

Comments

Possible workaround: Use popToViewController(controller, animated: false)

By philip.vasilchenko at Sept. 25, 2020, 1:24 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!