-1
我有tableView
。我想創建一個新的自定義刪除操作!但它需要一個新的indexPath
。如何獲得新的indexPath
?如何爲tableView獲取新的NSIndexPath?
這裏是我的代碼:
func newFunction(sender:UIButton) {
let indexPath = NSIndexPath(forRow: 0, inSection: 0)
self.tableView.beginUpdates()
self.items.removeAtIndex(indexPath.row)
self.tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.Fade)
self.tableView.endUpdates()
self.tableView.reloadData()
}
它的工作原理。但只刪除第一個對象。