Animation ends after UITableView manually reorders

UITableView has a built-in animation in which, after reordering a cell, it gently lies in free space. Is there a place where you can use some kind of notification after the end of the animation? I would like to name the method upon completion. At the moment I am using performSelector:withObject:afterDelay:, which works fine at the moment, but I would like to know if full animation can be used.
I repeat, I'm not talking about custom animation, but only the animation built into the UITableView.

I searched and can not find the answer.

+5
source share
2 answers

, , , , @Gobot. , , . @Mitchell Vanderhoeff,

- (void)tableView:(UITableView *)tableView
        moveRowAtIndexPath:(NSIndexPath *)fromIndexPath
        toIndexPath:(NSIndexPath *)toIndexPath {
        [CATransaction setCompletionBlock:^{
            // Completion code here
        }];
}

tableview, , . , , CATCansaction setCompletionBlock. , tableview . , , , , .

QuartzCore, .

+4

, . . , ,

tableViewCell.showsReorderControl = YES;

. , , :

- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath;

, , , . , , , :

- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath {
    [self doMyFavoriteThing];
}

! , , , , .

0

All Articles