Method: CAAnimation.basic
- Defined in:
- lib/cocoa/sugarcube-animations/caanimation.rb
.basic(key_path, options = {}, &block) ⇒ Object
If you pass a block, that block will be called at the end of the animation.
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cocoa/sugarcube-animations/caanimation.rb', line 17 def basic(key_path, ={}, &block) animation = CABasicAnimation.animationWithKeyPath(key_path) (animation, ) fill_mode = .fetch(:fill_mode, KCAFillModeForwards) animation.fillMode = fill_mode animation.fromValue = [:from] if .key?(:from) animation.toValue = [:to] if .key?(:to) animation.byValue = [:by] if .key?(:by) return animation end |