Use a UITabBarController to load two ViewControllers, A and B, both wrapped in UINavigationController.
In A’s viewDidLoad method, push to C, with C’s hidesBottomBarWhenPushed set to true. When popping back to A, the tab bar flickers and then disappears.
In versions lower than iOS 18, after popping back, the tabBar does not flicker and disappear.
A ViewController
override func viewDidLoad() {
super.viewDidLoad()
let vc = CViewController()
vc.hidesBottomBarWhenPushed = true
navigationController?.pushViewController(vc, animated: true)
// Do any additional setup after loading the view.
}