Commit 67550d30 by Daniel Dahan

updated motion API to animate

parent 61eb033d
...@@ -123,8 +123,8 @@ extension CALayer { ...@@ -123,8 +123,8 @@ extension CALayer {
A function that accepts a list of MotionAnimation values and executes them. A function that accepts a list of MotionAnimation values and executes them.
- Parameter animations: A list of MotionAnimation values. - Parameter animations: A list of MotionAnimation values.
*/ */
public func motion(_ animations: MotionAnimation...) { public func animate(_ animations: MotionAnimation...) {
motion(animations) animate(animations)
} }
/** /**
...@@ -132,8 +132,8 @@ extension CALayer { ...@@ -132,8 +132,8 @@ extension CALayer {
- Parameter animations: An Array of MotionAnimation values. - Parameter animations: An Array of MotionAnimation values.
- Parameter completion: An optional completion block. - Parameter completion: An optional completion block.
*/ */
public func motion(_ animations: [MotionAnimation], completion: (() -> Void)? = nil) { public func animate(_ animations: [MotionAnimation], completion: (() -> Void)? = nil) {
motion(delay: 0, duration: 0.35, timingFunction: .easeInOut, animations: animations, completion: completion) animate(delay: 0, duration: 0.35, timingFunction: .easeInOut, animations: animations, completion: completion)
} }
/** /**
...@@ -144,7 +144,7 @@ extension CALayer { ...@@ -144,7 +144,7 @@ extension CALayer {
- Parameter animations: An Array of MotionAnimations. - Parameter animations: An Array of MotionAnimations.
- Parameter completion: An optional completion block. - 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 var t = delay
for v in animations { for v in animations {
......
...@@ -173,8 +173,8 @@ public extension UIView { ...@@ -173,8 +173,8 @@ public extension UIView {
them on the view's backing layer. them on the view's backing layer.
- Parameter animations: A list of MotionAnimation values. - Parameter animations: A list of MotionAnimation values.
*/ */
func motion(_ animations: MotionAnimation...) { func animate(_ animations: MotionAnimation...) {
layer.motion(animations) layer.animate(animations)
} }
/** /**
...@@ -183,8 +183,8 @@ public extension UIView { ...@@ -183,8 +183,8 @@ public extension UIView {
- Parameter animations: An Array of MotionAnimation values. - Parameter animations: An Array of MotionAnimation values.
- Parameter completion: An optional completion block. - Parameter completion: An optional completion block.
*/ */
func motion(_ animations: [MotionAnimation], completion: (() -> Void)? = nil) { func animate(_ animations: [MotionAnimation], completion: (() -> Void)? = nil) {
layer.motion(animations, completion: completion) 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