ios - 我想从不同的 uiviewController 返回选项卡 ViewController 的特定页面

标签 ios swift xcode

我已经实现了一些页面的 tabViewController 。其中一个页面是表格 View Controller 。单击 TableView 项后,我将打开另一个 View Controller 。现在我想返回到该特定页面。该选项卡页的 selectedIndex 为 1。 我该怎么做?

感谢您的帮助

store board

最佳答案

试试这个

let tabBar: UITabBarController = self.window?.rootViewController as! UITabBarController

tabBar.selectedIndex = 1

关于ios - 我想从不同的 uiviewController 返回选项卡 ViewController 的特定页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48137994/

相关文章:

ios - 如何在 Swift 中创建序列?

iOS Swift 库 - 目标具有传递依赖性 Google Analytics

ios - TableView Cell Button 更改其他单元格的内容

ios - 如果使用cocoapods,如何保持标题路径?

iphone - 如何使用 UISlider 以及如何在特定值上设置 slider ?

iphone - 添加 Core Data 对象后 tableView 未更新

ios - 动态设置 UICollectionViewCell 的大小

objective-c - 使用 Instruments 测试 iOS 应用程序开发的最佳实践

ios - 使用 alamofire 的多部分/表单数据

objective-c - 谷歌API错误 "Multiple methods named ' initWithArray :' found"