【发布时间】:2018-02-10 19:56:21
【问题描述】:
我一直在尝试自己解决这个问题,但无法解决。
我想从我的 AppDelegate 加载一个标签栏控制器(在 Google 成功登录到应用程序之后)。
我在这里阅读了如何从 AppDelegate 加载 ViewController
Perform Segue from App Delegate swift
示例中的代码:
// Access the storyboard and fetch an instance of the view controller
let storyboard = UIStoryboard(name: "Main", bundle: nil);
let viewController: MainViewController = storyboard.instantiateViewController(withIdentifier: "ViewController") as! MainViewController;
// Then push that view controller onto the navigation stack
let rootViewController = self.window!.rootViewController as! UINavigationController;
rootViewController.pushViewController(viewController, animated: true);
根据我的理解,在此示例中,我的 TabBar 需要名称和标识符。
有人可以向我解释一下吗?我在 Tab Bar Controller 上找不到“标识符”,只有“标题”。
另外,我的应用中没有导航控制器视图。
【问题讨论】:
标签: ios swift xcode uitabbarcontroller appdelegate