Core animation equivalent for built-in UIView animation
I'm looking for an equivalent core animation for the following UIView animation?
[UIView animateWithDuration:0.25 animations:^(void) {
cell.frame = newCellFrame;
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.25 animation:^(void) {
cell.frame = finalCellFrame;
}];
}];
What I would like to know in particular is how you mimic the "c开发者_如何转开发ompletion" part of this animation with core animation. Is the only option to use core animation delegation or is there a solution as elegant as the above code snippet?
In CoreAnimation it's done with delegates. You can set a delegate on your CAAnimation/CABasicAnimation instance, and the animation will make animationDidStart:
and animationDidStop:finished:
callbacks to you.
精彩评论