Last active
December 28, 2015 09:53
-
-
Save IamAlchemist/ea47e7983e64a8edd20b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let pathAnimation = CABasicAnimation(keyPath: "strokeEnd"); | |
pathAnimation.duration = 10 | |
pathAnimation.fromValue = NSNumber(float: 0) | |
pathAnimation.toValue = NSNumber(float: 1) | |
pathLayer?.addAnimation(pathAnimation, forKey: "strokeEnd") | |
let penAnimation = CAKeyframeAnimation(keyPath: "position") | |
penAnimation.duration = 10 | |
penAnimation.path = pathLayer?.path | |
penAnimation.calculationMode = kCAAnimationPaced | |
penAnimation.delegate = self | |
penAnimation.fillMode = kCAFillModeForwards | |
penLayer.addAnimation(penAnimation, forKey: "position") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment