[self.tableView reloadSections:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 1)] withRowAnimation:UITableViewRowAnimationLeft];
[self.tableView reloadRowsAtIndexPaths:@[ [NSIndexPath indexPathForItem:1 inSection:1]] withRowAnimation:UITableViewRowAnimationRight];
Nel codice precedente come si esegue la seconda riga dopo che l'animazione dalla prima riga è stata completata?Come posso attendere fino al completamento di un'animazione incorporata di UITableView?
Ho provato questo ...
[self.tableView beginUpdates];
[self.tableView reloadSections:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 1)] withRowAnimation:UITableViewRowAnimationLeft];
{
[self.tableView beginUpdates];
[self.tableView reloadRowsAtIndexPaths:@[ [NSIndexPath indexPathForItem:1 inSection:1]] withRowAnimation:UITableViewRowAnimationRight];
[self.tableView endUpdates];
}
[self.tableView endUpdates];
e questo ...
[self.tableView beginUpdates];
{
[self.tableView reloadSections:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 1)] withRowAnimation:UITableViewRowAnimationLeft];
}
[self.tableView endUpdates];
[self.tableView beginUpdates];
{
[self.tableView reloadRowsAtIndexPaths:@[ [NSIndexPath indexPathForItem:1 inSection:1]] withRowAnimation:UITableViewRowAnimationRight];
}
... ma in entrambi i casi le animazioni sono chiaramente accadendo allo stesso tempo (e davvero evidente quando lento le animazioni sono attive).
Si può prendere l'aiuto di questo http://stackoverflow.com/questions/3832474/uitableview-row-animation-duration-and-completion-callback – Iducool
Sembrerebbe questo è come è fatto: http://stackoverflow.com/questions/2802146/callback-for-uitableview-animations – Dev2rights