【发布时间】:2017-08-31 07:57:10
【问题描述】:
这对我来说似乎很补救,但我遇到了问题。我只是想在点击某个静态单元格时转换到另一个 tableviewcontroller。
我从单元格中控制单击到新的 tableviewcontroller,这没有问题——segue 已创建。但是当我运行应用程序时,单击单元格时没有任何反应。有人弹出同样的问题吗?
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let storyboard : UIStoryboard = UIStoryboard (name: "groups", bundle: nil)
let groupsVC = storyboard.instantiateViewController(withIdentifier: "groups") as! GroupsViewController
if indexPath.section == 1 && indexPath.row == 0 {
self.navigationController?.pushViewController(groupsVC, animated: true)
}
【问题讨论】:
-
你能展示你尝试过的代码吗
-
我没有要显示的。我的印象是它就像一个 uibutton 一样工作,您可以从按钮拖动到情节提要中的新视图控制器。
标签: ios swift uitableview