Commit 67550d30 by Daniel Dahan

updated motion API to animate

parent 61eb033d
......@@ -123,8 +123,8 @@ extension CALayer {
A function that accepts a list of MotionAnimation values and executes them.
- Parameter animations: A list of MotionAnimation values.
*/
public func motion(_ animations: MotionAnimation...) {
motion(animations)
public func animate(_ animations: MotionAnimation...) {
animate(animations)
}
/**
......@@ -132,8 +132,8 @@ extension CALayer {
- Parameter animations: An Array of MotionAnimation values.
- Parameter completion: An optional completion block.
*/
public func motion(_ animations: [MotionAnimation], completion: (() -> Void)? = nil) {
motion(delay: 0, duration: 0.35, timingFunction: .easeInOut, animations: animations, completion: completion)
public func animate(_ animations: [MotionAnimation], completion: (() -> Void)? = nil) {
animate(delay: 0, duration: 0.35, timingFunction: .easeInOut, animations: animations, completion: completion)
}
/**
......@@ -144,7 +144,7 @@ extension CALayer {
- Parameter animations: An Array of MotionAnimations.
- Parameter completion: An optional completion block.
*/
fileprivate func motion(delay: TimeInterval, duration: TimeInterval, timingFunction: CAMediaTimingFunctionType, animations: [MotionAnimation], completion: (() -> Void)? = nil) {
fileprivate func animate(delay: TimeInterval, duration: TimeInterval, timingFunction: CAMediaTimingFunctionType, animations: [MotionAnimation], completion: (() -> Void)? = nil) {
var t = delay
for v in animations {
......
......@@ -173,8 +173,8 @@ public extension UIView {
them on the view's backing layer.
- Parameter animations: A list of MotionAnimation values.
*/
func motion(_ animations: MotionAnimation...) {
layer.motion(animations)
func animate(_ animations: MotionAnimation...) {
layer.animate(animations)
}
/**
......@@ -183,8 +183,8 @@ public extension UIView {
- Parameter animations: An Array of MotionAnimation values.
- Parameter completion: An optional completion block.
*/
func motion(_ animations: [MotionAnimation], completion: (() -> Void)? = nil) {
layer.motion(animations, completion: completion)
func animate(_ animations: [MotionAnimation], completion: (() -> Void)? = nil) {
layer.animate(animations, completion: completion)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment