答案 0 :(得分:5)
您应该实施delegate
方法 - commitEditingStyle
,您将完成!!
之类的,
func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath)
{
// below code will delete one row - you can mange another kind of deletion here like delete from database also
if editingStyle == .Delete
{
yourDataArray.removeAtIndex(indexPath.row)
self.yourTableView.reloadData()
}
}
你可以按下按钮,
self.yourTableView.setEditing(true, animated: true)
在每个单元格上显示( - )符号!