How can I tell when [UITableView setEditing:YES animated:YES] has completed?
I don\'t want to give any context, because I want to avoid anybody giving me workarounds
[CATransaction begin];
[CATransaction setCompletionBlock: ^{
// your animation has finished
}];
[tableView setEditing:YES animated:YES];
[CATransaction commit];
Note that setCompletionBlock
must be on the top.
Swift 4 version of accepted answer:
CATransaction.begin()
CATransaction.setCompletionBlock {
// your animation has finished
}
tableView.setEditing(true, animated: true)
CATransaction.commit()
In iOS 4 you can do the following:
[UIView animateWithDuration:0.3f
animations:^{
[self.tableView setEditing:YES animated:NO];
}
completion:^(BOOL finished){
// Do something
}
];