Skip to content

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

License

Notifications You must be signed in to change notification settings

loveinsky100/XYZAnimation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published