我正在使用根控制器通过使用 Window 来更改我的故事板:
Auth.auth().addStateDidChangeListener() { auth, user in
if user != nil {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(identifier: "main")
self.window?.rootViewController?.present(vc, animated: true, completion: nil)
self.window?.makeKeyAndVisible()
}
}
上面的代码在func应用程序内的委托中
问题是它没有进入我的故事板,标识符为“main”
问题:如果在我的情况下故事板的标识符是“main”,当用户登录时如何更改 VC
我上面的代码不起作用(