【发布时间】:2016-08-26 06:43:40
【问题描述】:
我想从AppDelegate 转到UITabBarController 的第一视图。
我将UITabBarController 中的StoryBoardID 分配为“主页”。
我尝试了以下代码:
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let viewController: UITabBarController = storyboard.instantiateViewControllerWithIdentifier("HomePage") as! UITabBarController
let rootViewController = self.window!.rootViewController as! UINavigationController
rootViewController.pushViewController(viewController, animated: true)
它有效,但我在我不想要的目标视图上给出了BackBarButton。
我现在想继续。
【问题讨论】:
-
查看我最近的回答:(stackoverflow.com/questions/39159444/… 在 Swift 编程中获得基于导航的模板功能)?
标签: ios swift uitabbarcontroller segue appdelegate