我实现了一个 UITabBarController
并实现了几个选项卡。现在我在 UITabBarItem
中有一个按钮,我想从那里切换到特定的选项卡。我已经看到使用导航 Controller 的答案,但就我而言,我没有使用导航 Controller 。
NOTE: I have copied this screenshot from the internet so please ignore the navigation bar. I want an answer without using navigation controller.
最佳答案
就用这个。
self.tabBarController.selectedIndex = indexToWhichYouWantToMove;
tabBarController
是您的 TabBarController
关于ios - Swift - 从按钮点击打开特定的标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46067738/