/XYZAnimation

Start CAAnimation with Chain programming! 使用链式语法编写顺序动画同步动画,动画结束回调

Primary LanguageObjective-CCreative Commons Zero v1.0 UniversalCC0-1.0

XYZAnimation

Start CAAnimation with Chain programming!

If you want to use CAAnimation to create an Sequential Animation, you may write code like this:

[cirleLayer makeCAAnimation:^(XYZAnimationMaker *maker) {
    maker.addAnimation(animation)
         .withFinishCallBack(^(){ NSLog(@"strokeEnd finish"); });
    maker.startGroup
         .inDuration(3)
         .withAutoreverses(NO)
         .withFillMode(kCAFillModeForwards)
         .andRemoveOnCompletion(NO);
         .withFinishCallBack(^(){ NSLog(@"group finish"); });
    maker.basicAnimation
         .from(@0)
         .to(@10)
         .withKeyPath(@"lineWidth")
         .inDuration(2)
         .withAutoreverses(NO)
         .withFillMode(kCAFillModeForwards)
         .andRemoveOnCompletion(NO);
    maker.keyframeAnimation
         .withPath(movePath.CGPath)
         .withKeyPath(@"position")
         .inDuration(3)
         .withAutoreverses(NO)
         .withFillMode(kCAFillModeForwards)
         .andRemoveOnCompletion(NO);
    maker.endGroup();
    maker.basicAnimation
         .from(@0)
         .to(@1)
         .withKeyPath(@"strokeStart")
         .inDuration(2)
         .withAutoreverses(NO)
         .withFillMode(kCAFillModeForwards)
         .andRemoveOnCompletion(NO);
}];

image