在tableview中选择多个,仅将单个数据添加到列表
如何在数组中添加多个数据?
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "toGrafikVC" {
let giden = segue.destination as! grafikVC
if let gidenIndexPath = self.tableView.indexPathForSelectedRow {
giden.GelenDersIDArray.append(dersIDArray[gidenIndexPath.row])
giden.gelenAd = dersAdiArray[gidenIndexPath.row]
}
}
}
@IBAction func kaydetButton(_ sender: UIBarButtonItem) {
performSegue(withIdentifier: "toGrafikVC", sender: nil)
}