【发布时间】:2018-12-03 15:22:33
【问题描述】:
下面的代码会打印在我的 TableView 中单击的任何单元格的内容。
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print(self.cell[indexPath.row])
}
我想使用打印在另一个 ViewController 上的标签中的结果。
如何从函数中获取字符串值,然后在另一个视图上使用它?我的想法是使用全局变量,但我需要先获取字符串值。
【问题讨论】:
-
你想显示另一个来自
didSelectRowAt方法的视图控制器吗?
标签: ios swift label global-variables tableview