当我以编程方式从视图控制器推送到标签栏控制器时,它会在现有导航栏的顶部添加导航栏。在标签栏控制器中,我有三个嵌入了导航控制器的视图控制器。现在我的问题是如何以编程方式推送显示现有导航栏的标签栏控制器?当我以编程方式呈现给标签栏控制器但我想以编程方式推送到标签栏控制器时,它的工作非常完美。下面是我用来推送到标签栏的代码
let tabBarController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "tabbarController") as? UITabBarController
let nav = tabBarController?.viewControllers?[0] as! UINavigationController
let guestVC = nav.topViewController as! guestProfileViewController
let nav1 = tabBarController?.viewControllers?[1] as! UINavigationController
let guestVC1 = nav1.topViewController as! newGuestPhotoViewController
let nav2 = tabBarController?.viewControllers?[2] as! UINavigationController
let guestVC2 = nav2.topViewController as! newGuestVideoViewController
self.navigationController?.pushViewController(tabBarController!, animated: true)
但我想只显示现有的导航栏,如下所示。任何帮助都感激不尽!提前致谢