UITableViewCell
sの並べ替えとスワイプによる削除を許可したいのですが、赤い削除サークルでは許可していません。
- (void)loadView
{
[super loadView];
[table setEditing:YES animated:NO];
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Perform delete here
}
}
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
// Perform move here
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
return UITableViewCellEditingStyleDelete;
}
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
return YES;
}
さらに、編集モードを無効にし-[UITableViewCell setShowsReorderControl:YES]
て、運が悪かったので電話をかけてみました。
(出典:booleanmagic.com)