我有一些單元格(圖像波紋管)由tab []創建我需要在這個視圖上繼續正確的值到另一個視圖(moreViewController)我有'nazwa''szerokosc''dlugosc',我需要保存到nazwa正確的「地方」從細胞等 有人有任何解決辦法?我搜索,但我沒有找到:/Segue與TableView
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath){
self.performSegue(withIdentifier: "more", sender: tableView)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let destViewController:moreViewController = segue.destination as! moreViewController
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return nazwaTab.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! cellTableViewCell
let nazwa = nazwaTab[indexPath.row]
let szerokosc = szerokoscTab[indexPath.row]
let dlugosc = dlugoscTab[indexPath.row]
cell.nazwaLabel.text = nazwa
cell.szerokoscLabel.text = szerokosc
cell.dlugoscLabel.text = dlugosc
return (cell)
}
問題是什麼選擇獲取文本? –
你的問題不清楚。 「你需要從細胞等保存到nazwa正確的」地方「是什麼意思?」。 你想得到哪個圖像/標籤被點擊或什麼? – Priyal
Nooo,當我點擊某個單元格時,我需要將https://scr.hu/BL69P4放到這個視圖中,但是當我點擊放置時18「nazwa」必須放置18,當我點擊放置時24「nazwa」必須放置24 – k0le