我有一个通用的 Swift 选项卡式应用程序。我希望能够通过 View Controller 之一内的 UIButton Touch 触发 tabbarcontroller 上的操作。
该按钮位于 View Controller 2 中,触摸时应通过 UITabbarController 触发返回 View Controller 1。
最佳答案
找到答案:
@IBAction func buttonClicked(sender: AnyObject) {
self.tabBarController?.selectedIndex = 0
}
**为您要访问的选项卡使用适当的索引
关于swift - 从 UIButton 触摸触发 UITabbarController 操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32212542/