5
選擇一個UITableViewCell後,我打電話如何在動畫上的UITableViewCell完成檢測取消行
[tableView deselectRowAtIndexPath:indexPath animated:YES]
內tableView:didSelectRowAtIndexPath:
這將顯示一個取消選擇動畫。我想知道在動畫完成時是否有任何方法可以檢測到。
選擇一個UITableViewCell後,我打電話如何在動畫上的UITableViewCell完成檢測取消行
[tableView deselectRowAtIndexPath:indexPath animated:YES]
內tableView:didSelectRowAtIndexPath:
這將顯示一個取消選擇動畫。我想知道在動畫完成時是否有任何方法可以檢測到。
[CATransaction begin];
[tableView beginUpdates];
[CATransaction setCompletionBlock: ^{
NSLog(@"Completion code here");
}];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
[tableView endUpdates];
[CATransaction commit];
感謝您的回答。僅供參考 - 未來的觀衆 - 我不相信'beginUpdates'和'endUpdates'調用在這個特定的例子中是絕對必要的。這些方法用於將單個動畫中的多個動作組合在一起,但由於此示例只有一個取消選擇動作,因此您也可以將它們留在此處。 – Matt
我會嘗試在[這個問題](http://stackoverflow.com/questions/3832474/uitableview-row-animation-duration-and描述了'CATransaction'與完成塊包裝這個說法完井回調)。 –