在导航中转换到根标签栏控制器 XCODE

问题描述

我遇到了从 ViewController 移回根标签栏控制器的问题。这是我的故事板,我附上了我的问题的图片

storyboard

我尝试了以下方法

let homeTBC = controllers![3] as! UITabBarController
        let homeVC = homeTBC.viewControllers?[0] as! HomeViewController
        self.present(homeVC,animated: true,completion: nil)

我收到此错误消息:

*** Terminating app due to uncaught exception 'NSinvalidargumentexception',reason: 'Application tried to present modally a view controller <ITEiOSApp.HomeViewController: 0x7fbb200bf000> that has a parent view controller <UITabBarController: 0x7fbb200bea00>.'
terminating with uncaught exception of type NSException

请帮助这里的选项真的用完了。

提前致谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)