How to animate NSView using keyframe

Issue #404

1
2
3
4
5
6
7
8
let animation = CAKeyframeAnimation(keyPath: "position.y")
animation.values = [50, 20, 50]
animation.keyTimes = [0.0, 0.5, 1.0]
animation.duration = 2
animation.repeatCount = Float.greatestFiniteMagnitude
animation.autoreverses = true
myView.wantsLayer = true
myView.layer?.add(animation, forKey: "bounce")

Comments