哪种是在Core Animation上下文中链接动画的最优雅和模块化的方式?
我的意思是做动画,当其他完成时开始(例如,改变position然后opacity)..正常的方法是直接改变属性:
layer.position = new_point;
layer.opacity = 0.0f;
Run Code Online (Sandbox Code Playgroud)
但这会同时做到这一点.我想让一个等待另一个.
那么为不同的对象链接动画呢?我读过关于CATransaction使用过的东西:
[CATransaction begin]
layer1.property = new_property;
[CATransaction begin]
layer2.property2 = new_property2;
[CATransaction commit];
[CATransaction commit];
Run Code Online (Sandbox Code Playgroud)
但它似乎没有工作..