单击 swift 中的表格视图单元格打开一个新的 TabBarController

Open a new TabBarController on clicking a tableview cell in swift

我是 Swift 的新手,如何在单击 tableviewcell 时打开一个新的 TabBarController。等待您的回复

你有很多好的解决方案: 1) 如果您使用故事板, 然后按住 control+从单元格拖动到您的 TabBarController。 2) 如果你想用代码来做到这一点并且你正在使用UINavigationController尝试通过推送到导航来做到这一点:

let VC1 = self.storyboard!.instantiateViewControllerWithIdentifier("MyViewController") as! ViewController
self.navigationController!.pushViewController(VC1, animated: true)

3) 如果您没有 UINavigationController,您可以像这样显示 VC:

let VC1 = ViewController() //change this to your class name
self.presentViewController(VC1, animated: true, completion: nil)

4) 如果您使用的是 Nibs(之前有这个小改动):

ViewController(nibNameOrNil: nil, bundleOrNil: nil)

如果你想要更多的资源,可以看看这个linkhere