Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect when animation completes on UITableViewCell deselect row

After selecting a UITableViewCell I call

[tableView deselectRowAtIndexPath:indexPath animated:YES]

inside tableView:didSelectRowAtIndexPath:

This displays a deselection animation. I'd like to know if there is any way to detect when this animation completes.

like image 484
Awesome-o Avatar asked Oct 10 '13 23:10

Awesome-o


1 Answers

[CATransaction begin];

[tableView beginUpdates];

[CATransaction setCompletionBlock: ^{

    NSLog(@"Completion code here");

}];

[tableView deselectRowAtIndexPath:indexPath animated:YES];
[tableView endUpdates];

[CATransaction commit];
like image 125
Mike Mellor Avatar answered Sep 28 '22 08:09

Mike Mellor