从AppDelegate执行segue时出现问题。我正在使用此代码从appdelagate进行搜索:
let storyboard = UIStoryboard(name: "MyStoryboard", bundle: nil)
let viewController: MyViewController = storyboard.instantiateViewController(withIdentifier: "myviewcontroller") as! MyViewController
let rootViewController = self.window!.rootViewController as! UINavigationController
rootViewController.show(viewController, sender: self)
当我使用它时,我的UITabBar被删除。我想选择不是TabBar项目的ViewController并保留我的UITabbar。我也在使用导航。我应该如何处理?
答案 0 :(得分:0)
要显示该标签,您需要从vcs标签中的1个进行推送,并且应将其嵌入导航中并使用
let nav = self.window!.rootViewController as! UINavigationController
if let tab = nav.viewControllers.first as? UITabBarController ,
let innerNav = tab.viewControllers.first as? UINavigationController {
innerNav.pushViewController(viewController,animated:true)
}