Commit f4a5cc8c by Daniel Dahan

development: simplified MotionAnimation API

parent a9620296
......@@ -282,7 +282,7 @@ extension CALayer {
} else {
let a = Motion.shadow(path: UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).cgPath)
a.fromValue = shadowPath
animate(animation: a)
animate(a)
}
}
}
......@@ -152,7 +152,7 @@ open class SlideMotionTransition: NSObject, UIViewControllerAnimatedTransitionin
if 0 < n.motionIdentifier.utf16.count {
for m in toView.subviews {
if n.motionIdentifier == m.motionIdentifier {
m.motion(duration: duration, animations: m.motionAnimations)
m.motion(m.motionAnimations)
}
}
}
......@@ -168,7 +168,7 @@ open class SlideMotionTransition: NSObject, UIViewControllerAnimatedTransitionin
if 0 < n.motionIdentifier.utf16.count {
for m in toView.subviews {
if n.motionIdentifier == m.motionIdentifier {
m.motion(duration: duration, animations: m.motionAnimations)
m.motion(m.motionAnimations)
}
}
}
......
......@@ -146,13 +146,13 @@ extension PulseMotion {
switch animation {
case .centerWithBacking, .backing, .pointWithBacking, .tap:
bLayer.motion(duration: duration, animations: .backgroundColor(color.withAlphaComponent(opacity / 2)))
bLayer.motion(.duration(duration), .backgroundColor(color.withAlphaComponent(opacity / 2)))
default:break
}
switch animation {
case .center, .centerWithBacking, .centerRadialBeyondBounds, .radialBeyondBounds, .point, .pointWithBacking:
pLayer.motion(duration: duration, animations: .scale(1))
pLayer.motion(.duration(duration), .scale(1))
default:break
}
......@@ -182,13 +182,13 @@ extension PulseMotion {
switch animation {
case .centerWithBacking, .backing, .pointWithBacking, .tap:
bLayer.motion(duration: duration, animations: .backgroundColor(color.withAlphaComponent(0)))
bLayer.motion(.duration(duration), .backgroundColor(color.withAlphaComponent(0)))
default:break
}
switch animation {
case .center, .centerWithBacking, .centerRadialBeyondBounds, .radialBeyondBounds, .point, .pointWithBacking:
pLayer.motion(duration: duration, animations: .scale(.center == animation ? 1 : 1.325), .backgroundColor(color.withAlphaComponent(0)))
pLayer.motion(.duration(duration), .scale(.center == animation ? 1 : 1.325), .backgroundColor(color.withAlphaComponent(0)))
default:break
}
......
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