我在我的应用上使用推送通知。因此,当我收到通知并触摸它时,我想转到另一个UITabbarcontroller
,但当我这样做时,该应用仅显示UINavigationbar
而不显示UITabbarcontroller
。这是一个截图 - >
这是我的代码。
let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "RequestDriverViewController") as! RequestDriverViewController
let nc = UINavigationController(rootViewController: vc)
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = nc
self.window?.makeKeyAndVisible()
答案 0 :(得分:-1)
我能够解决它:
let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "TabBarIdentifier") as! UITabBarController
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = vc
self.window?.makeKeyAndVisible()