我目前在一个小型的iOS项目上工作,遇到问题:
该应用程序以Navigation View Controller
开头,用于登录和注册。在此NavigationVC的最后一个视图控制器上完成注册后,我想重定向到主Tab Bar Controller
。
问题是左侧和右侧之间缺少序列。 Xcode提出的所有建议的Segues都不起作用。 modal Segue
是无选项,show Segue
带有NavigationController的NavBar。
我希望你们对如何解决这个问题有想法。感谢您的帮助。祝你有美好的一天!
您可以通过以下方式简单地弹出:
popToViewController:animated
或
ObjectiveC:
[self.navigationController popToRootViewControllerAnimated:YES]
Swift:
self.navigationController?.dismiss(animated: true)
您可以重新考虑您的导航体系结构。
将tabBarController的第一个视图控制器命名为“ HomeViewController”
实现它的一种方法是:
您现在已经在HomeViewController顶部显示了登录过程。
注册完成后,关闭loginViewController。
您现在回到HomeViewController并完成注册。
此外,您可以使用NotificationCenter来警告HomeViewController用户刚刚登录并执行任何初始工作。