I am trying to animate the opacity of a CALayer but the values are more than one value to begin with and one to end with.
For example: I want it to animate throw these values: 0.0, 0.7, 0.3, 1.0, 0.5, 0.0
I also want the animation to repeat with auto reverse. This is what I have for now:
let redLineAnimation = CABasicAnimation(keyPath: "opacity") redLineAnimation.duration = 0.4 redLineAnimation.autoreverses = true redLineAnimation.fromValue = 0.0 redLineAnimation.toValue = 1.0 redLineAnimation.repeatCount = Float.infinity movingRedLineLayer.addAnimation(redLineAnimation, forKey: nil) I am new to iOS development. What can I do? Thanks!
CAKeyframeAnimationclass reference: developer.apple.com/library/ios/documentation/GraphicsImaging/…