【发布时间】:2016-06-03 06:48:43
【问题描述】:
在我检查了我的 tableview 列表中的多个项目后,我想将它们从我的列表中删除并将它们添加到收藏夹列表中。
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
//this is to make multiple selections in list
tableView.cellForRowAtIndexPath(indexPath)?.accessoryType = UITableViewCellAccessoryType.Checkmark
//this gives me an array for rowsSelected
let rowsSelected = self.tableView.indexPathsForSelectedRows!.map{$0.row}
completeList.removeAtIndex(rowsSelected)
//tried this alternative - not sure what type "selection" is here
let selection = tableView.indexPathsForSelectedRows{
completeList.removeAtIndex(rowsSelected)
}
【问题讨论】:
标签: arrays swift uitableview selection