1.判断当前tableView是否处于编辑状态
self.tableView.isEditing
2.设置编辑的状态
[self.tableViewsetEditing:NOanimated:YES]
3.返回编辑的模式是删除还是添加
- (UITableViewCellEditingStyle)tableView:(UITableView*)tableView
editingStyleForRowAtIndexPath:(NSIndexPath*)indexPath
4.在indexPath的位置插入一行
[tableViewinsertRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationFade];//这里写的是插入的位置
5.返回编辑的风格 只有写了这里 才会显示可以添加(插入)的效果
- (UITableViewCellEditingStyle)tableView:(UITableView*)tableView
editingStyleForRowAtIndexPath:(NSIndexPath*)indexPath
6.push到下一个界面回来时清除选择 该控制器特有的方法 默认为YES
self.clearsSelectionOnViewWillAppear=
NO;
7.此控制器会默认自己签订dataSource delegate协议
8.做放大头视图的动画时 只能放大头视图上的子视图才会正常 头视图(tableHeaderView)只能修改size 不能修改位置
UIView *view = [[UIView
alloc]
initWithFrame:CGRectMake(0,
0,
320,
150)];
[view
addSubview:_label];
self.tableView.tableHeaderView
= view;