/**
设置
TableView
是否可以编辑
*/
- ( void )setEditing:( BOOL )editing animated:( BOOL )animated{
[ super setEditing :editing animated :animated];
}
/** 设置所有 Cell 都可以编辑 */
- ( BOOL )tableView:( UITableView *)tableView canEditRowAtIndexPath:( NSIndexPath *)indexPath {
return YES ;
}
/** 设置编辑风格 */
- ( UITableViewCellEditingStyle )tableView:( UITableView *)tableView editingStyleForRowAtIndexPath:( NSIndexPath *)indexPath{
// 删除
return UITableViewCellEditingStyleDelete ;
- ( void )setEditing:( BOOL )editing animated:( BOOL )animated{
[ super setEditing :editing animated :animated];
}
/** 设置所有 Cell 都可以编辑 */
- ( BOOL )tableView:( UITableView *)tableView canEditRowAtIndexPath:( NSIndexPath *)indexPath {
return YES ;
}
/** 设置编辑风格 */
- ( UITableViewCellEditingStyle )tableView:( UITableView *)tableView editingStyleForRowAtIndexPath:( NSIndexPath *)indexPath{
// 删除
return UITableViewCellEditingStyleDelete ;
}
/**
提交编辑操作
*/
- ( void )tableView:( UITableView *)tableView commitEditingStyle:( UITableViewCellEditingStyle )editingStyle forRowAtIndexPath:( NSIndexPath *)indexPath {
NSLog ( @"123" );
- ( void )tableView:( UITableView *)tableView commitEditingStyle:( UITableViewCellEditingStyle )editingStyle forRowAtIndexPath:( NSIndexPath *)indexPath {
NSLog ( @"123" );
}
/**
侧拉时显示的文字
*/
- (
NSString
*)tableView:(
UITableView
*)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(
NSIndexPath
*)indexPath
{
return @" 删除 " ;
{
return @" 删除 " ;
}