我有一个用户可以登录的应用程序。如果用户启动应用程序并且已经登录,则rootViewController
设置为我的自定义UITabBarController
,但当用户未登录时,rootViewController
设置为 LoginVC(视图控制器)。我的问题是,当用户注销时,应该显示 LoginVC,并且应该取消初始化 TabBar。
我努力了:
self.tabBarController?.dismiss(animated: true, completion: {
self.tabBarController?.present(LoginVC(), animated: true, completion: nil)
})
诸如此类的事情......我可以展示 LoginVC 但是当我调用self.tabBarController?.dismiss
LoginVC 而不是 TabBarVC
任何帮助将不胜感激