按下到下一个表格视图

时间:2017-10-16 15:11:06

标签: ios swift xcode tableview rows

我有两个包含数据的表视图,第一个完全没问题。我想从这个表视图推送到另一个视图到另一个表视图,但我不能为它设置行。如何在

中浏览多维数组
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell

基本上,我的问题是为行设置正确的文本并从多维数组中获取:)(P.S。我在每个子数组中有不同数量的字符串)

1 个答案:

答案 0 :(得分:0)

您只需要检查要设置值的tableView。

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
  if tableView == myFirstTableView {
    // put the data for the first tableView
  } else {
    // put the data for the second tableview
  }
}