Ald*_*rdi 4 uitableview tableviewcell ios swift
当我们触摸按钮时如何自动滑动单元格,如添加联系人?那有代表吗?
你应该实施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()
}
}
Run Code Online (Sandbox Code Playgroud)
你可以按下按钮,
self.yourTableView.setEditing(true, animated: true)
Run Code Online (Sandbox Code Playgroud)
在每个细胞上显示( - )标志!
| 归档时间: |
|
| 查看次数: |
1751 次 |
| 最近记录: |