在 indexpath.item 以编程方式呈现 UIViewController(嵌入 UITabBarController)

Present programmatically a UIViewController (embed in an UITabBarController) at indexpath.item

我需要以编程方式呈现特定的 ViewController,其中包含取决于其行/项目(来自 UICollectionView)的信息。 但是这个 ViewController 嵌入在 TabBarController 中,我不知道如何获取数组中包含的信息。

我习惯于像这样在 UITableViewRowAction 中直接呈现它:

    let MyEditingController = MySpecificController()

    MyEditingController.delegate = self

    MyEditingController.Object = arrayOfObjects[indexPath.item]

    let navController = CustomNavigationController(rootViewController: MyEditingController)

    present(navController, animated: true, completion: nil)

这将正确显示 MySpecificController 但如何在需要嵌入 UITabBarController 时显示此控制器:MySpecificController 应该是此 TabBar 显示的 4 个屏幕的第一个项目。

有 idea/suggestion 吗?

感谢您的帮助!

忘了我的问题.... 我犯了一个 "noob" 错误,答案就在我的脑海中:我重构了我构建 TabBar 的方式,因为我可以到达我的每个 VC 当然,我 "simply" 改变了我的 presentedViewController .... 现在,它完美地工作 见鬼!对不起那些试图帮助我的人。