小编Kib*_*ibo的帖子

Swift - 如何使用ViewController中的按钮到特定的TabBarController

从Swift中的TabBarController之前的ViewController,我想发送到TabBarController之后的特定Tab,它可能是NavigationController或简单的ViewController.

目前我这样做:

@IBAction func settingsButtonPressed(sender: AnyObject) {
        tabBarController?.selectedIndex = 3 // 4d tab
        performSegueWithIdentifier("tabBarShow", sender: self)
}
Run Code Online (Sandbox Code Playgroud)

通过此操作,它执行segue但始终显示第一个选项卡.

谢谢您的帮助!

uitabbarcontroller ios swift

1
推荐指数
1
解决办法
2829
查看次数

标签 统计

ios ×1

swift ×1

uitabbarcontroller ×1