简体   繁体   English

从TabBarController选择特定选项卡中的特定VC

[英]Segue to Specific VC in specific Tab from TabBarController

Im quite new to swift/iOS development and i do noz know how to accomplish my current goal. 我是Swift / iOS开发的新手,我也不知道如何实现当前目标。

If the User presses a Button in Tab A, i want the TabBarController to switch to Tab B. But i also want to show a specific View Controller in Tab B. Tab B consists of a Navigation Controller with three Scenes and i need to show the second one, regardless of whether or not the user already visited Tab B. 如果用户按下选项卡A中的按钮,则我希望TabBarController切换到选项卡B。但是我也想在选项卡B中显示特定的视图控制器。选项卡B由具有三个场景的导航控制器组成,我需要显示第二个,无论用户是否已经访问过选项卡B。

I already tried to switch the Tab using selectedIndex, but i have no idea how i can then show the second VC for this Tab. 我已经尝试使用selectedIndex切换选项卡,但是我不知道如何显示该选项卡的第二个VC。

Is there any good way to accomplish this? 有什么好的方法可以做到这一点吗?

  • You Have to Load Navigation Controller on tab B 您必须在选项卡B上加载导航控制器
  • And then fire one segue for pushing second view controller 然后触发一个segue以推动第二个视图控制器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM