How can I combine multiple CAKeyframeAnimations into single keyframe animation?
Say I want to combine transform
CAKeyframeAnimation *animation = [CAKeyframeAnimation
animationWithKeyPath:@"transform"];
and opacity
CAKeyframeAnimation *animation = [CAKeyframeAnimation
an开发者_开发问答imationWithKeyPath:@"opacity"];
into keyframe animation. How do I combine and specify transform/opacity values for each keyframe?
Create two animations just like you do, use the same keyTimes
for both of them, and add them both to the layer with addAnimation:forKey:
. It's that easy.
精彩评论