カスタムセルを作ってごにゃごにゃやるのかと思ったら、すごく簡単だった。
要は編集モード用のAccessoryTypeがあるのです。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = @"テスト";
// 標準時はインディケータ
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
// 編集モード時はボタン
cell.editingAccessoryType = UITableViewCellAccessoryDetailDisclosureButton;
return cell;
}
これで編集モードに変更すれば、スルリと変わります。