【发布时间】:2018-04-19 15:22:48
【问题描述】:
我将 LoginVC 嵌入到 NavigationController 中,并在登录时将用户推送到 SwitchboardVC。
如果用户已经登录,我会在 didFinishLaunchingWithOptions 的 AppDelegate 中使用此代码绕过登录屏幕:
if Auth.auth().currentUser != nil
{
let mainStoryBoard: UIStoryboard = UIStoryboard(name:"Main", bundle:nil)
let nextView: SwitchboardVC = mainStoryBoard.instantiateViewController(withIdentifier: "SwitchboardVC") as! SwitchboardVC
self.window?.rootViewController = nextView
}
当我必须登录时,导航栏会显示在所有屏幕上,但如果我已经登录,导航栏会在所有其他屏幕上消失。
我还没有在 Google 上找到解决方案,但我假设我没有在搜索正确的术语。
非常感谢任何帮助
【问题讨论】:
标签: ios swift uinavigationcontroller