简体   繁体   中英

Push to the next table view

I have two table views containing data, the first one is completely okay. I want to push from this table view to another view to another table view, but I cannot set the rows for it. How can I navigate through a multidimensional array in

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell

Basically, my problem is about setting the right text for a row and getting from a multidimensional array :) (PS I have a different number of Strings in each subarray)

You just need to check on which tableView you are setting the values.

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
  }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM