Commit 654928d7 by Daniel Dahan

minor cleanup

parent d7408286
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Motion' s.name = 'Motion'
s.version = '1.3.4' s.version = '1.3.5'
s.license = 'MIT' s.license = 'MIT'
s.summary = 'A library used to create beautiful animations and transitions for Apple devices.' s.summary = 'A library used to create beautiful animations and transitions for Apple devices.'
s.homepage = 'http://cosmicmind.com' s.homepage = 'http://cosmicmind.com'
......
...@@ -199,7 +199,7 @@ fileprivate extension CALayer { ...@@ -199,7 +199,7 @@ fileprivate extension CALayer {
ts = ts, ts = ts,
completion = completion] in completion = completion] in
guard let s = self else { guard let `self` = self else {
return return
} }
...@@ -208,31 +208,31 @@ fileprivate extension CALayer { ...@@ -208,31 +208,31 @@ fileprivate extension CALayer {
if let v = ts.backgroundColor { if let v = ts.backgroundColor {
let a = MotionCAAnimation.background(color: UIColor(cgColor: v)) let a = MotionCAAnimation.background(color: UIColor(cgColor: v))
a.fromValue = s.backgroundColor a.fromValue = self.backgroundColor
anims.append(a) anims.append(a)
} }
if let v = ts.borderColor { if let v = ts.borderColor {
let a = MotionCAAnimation.border(color: UIColor(cgColor: v)) let a = MotionCAAnimation.border(color: UIColor(cgColor: v))
a.fromValue = s.borderColor a.fromValue = self.borderColor
anims.append(a) anims.append(a)
} }
if let v = ts.borderWidth { if let v = ts.borderWidth {
let a = MotionCAAnimation.border(width: v) let a = MotionCAAnimation.border(width: v)
a.fromValue = NSNumber(floatLiteral: Double(s.borderWidth)) a.fromValue = NSNumber(floatLiteral: Double(self.borderWidth))
anims.append(a) anims.append(a)
} }
if let v = ts.cornerRadius { if let v = ts.cornerRadius {
let a = MotionCAAnimation.corner(radius: v) let a = MotionCAAnimation.corner(radius: v)
a.fromValue = NSNumber(floatLiteral: Double(s.cornerRadius)) a.fromValue = NSNumber(floatLiteral: Double(self.cornerRadius))
anims.append(a) anims.append(a)
} }
if let v = ts.transform { if let v = ts.transform {
let a = MotionCAAnimation.transform(v) let a = MotionCAAnimation.transform(v)
a.fromValue = NSValue(caTransform3D: s.transform) a.fromValue = NSValue(caTransform3D: self.transform)
anims.append(a) anims.append(a)
} }
...@@ -252,55 +252,55 @@ fileprivate extension CALayer { ...@@ -252,55 +252,55 @@ fileprivate extension CALayer {
if let v = ts.position { if let v = ts.position {
let a = MotionCAAnimation.position(v) let a = MotionCAAnimation.position(v)
a.fromValue = NSValue(cgPoint: s.position) a.fromValue = NSValue(cgPoint: self.position)
anims.append(a) anims.append(a)
} }
if let v = ts.opacity { if let v = ts.opacity {
let a = MotionCAAnimation.fade(v) let a = MotionCAAnimation.fade(v)
a.fromValue = s.value(forKeyPath: MotionAnimationKeyPath.opacity.rawValue) ?? NSNumber(floatLiteral: 1) a.fromValue = self.value(forKeyPath: MotionAnimationKeyPath.opacity.rawValue) ?? NSNumber(floatLiteral: 1)
anims.append(a) anims.append(a)
} }
if let v = ts.zPosition { if let v = ts.zPosition {
let a = MotionCAAnimation.zPosition(v) let a = MotionCAAnimation.zPosition(v)
a.fromValue = s.value(forKeyPath: MotionAnimationKeyPath.zPosition.rawValue) ?? NSNumber(floatLiteral: 0) a.fromValue = self.value(forKeyPath: MotionAnimationKeyPath.zPosition.rawValue) ?? NSNumber(floatLiteral: 0)
anims.append(a) anims.append(a)
} }
if let v = ts.size { if let v = ts.size {
let a = MotionCAAnimation.size(v) let a = MotionCAAnimation.size(v)
a.fromValue = NSValue(cgSize: s.bounds.size) a.fromValue = NSValue(cgSize: self.bounds.size)
anims.append(a) anims.append(a)
} }
if let v = ts.shadowPath { if let v = ts.shadowPath {
let a = MotionCAAnimation.shadow(path: v) let a = MotionCAAnimation.shadow(path: v)
a.fromValue = s.shadowPath a.fromValue = self.shadowPath
anims.append(a) anims.append(a)
} }
if let v = ts.shadowColor { if let v = ts.shadowColor {
let a = MotionCAAnimation.shadow(color: UIColor(cgColor: v)) let a = MotionCAAnimation.shadow(color: UIColor(cgColor: v))
a.fromValue = s.shadowColor a.fromValue = self.shadowColor
anims.append(a) anims.append(a)
} }
if let v = ts.shadowOffset { if let v = ts.shadowOffset {
let a = MotionCAAnimation.shadow(offset: v) let a = MotionCAAnimation.shadow(offset: v)
a.fromValue = NSValue(cgSize: s.shadowOffset) a.fromValue = NSValue(cgSize: self.shadowOffset)
anims.append(a) anims.append(a)
} }
if let v = ts.shadowOpacity { if let v = ts.shadowOpacity {
let a = MotionCAAnimation.shadow(opacity: v) let a = MotionCAAnimation.shadow(opacity: v)
a.fromValue = NSNumber(floatLiteral: Double(s.shadowOpacity)) a.fromValue = NSNumber(floatLiteral: Double(self.shadowOpacity))
anims.append(a) anims.append(a)
} }
if let v = ts.shadowRadius { if let v = ts.shadowRadius {
let a = MotionCAAnimation.shadow(radius: v) let a = MotionCAAnimation.shadow(radius: v)
a.fromValue = NSNumber(floatLiteral: Double(s.shadowRadius)) a.fromValue = NSNumber(floatLiteral: Double(self.shadowRadius))
anims.append(a) anims.append(a)
} }
...@@ -326,7 +326,7 @@ fileprivate extension CALayer { ...@@ -326,7 +326,7 @@ fileprivate extension CALayer {
g.isRemovedOnCompletion = false g.isRemovedOnCompletion = false
g.timingFunction = ts.timingFunction g.timingFunction = ts.timingFunction
s.animate(g) self.animate(g)
if let v = ts.completion { if let v = ts.completion {
Motion.delay(duration, execute: v) Motion.delay(duration, execute: v)
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.3.4</string> <string>1.3.5</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string> <string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>
......
...@@ -559,12 +559,12 @@ internal extension MotionTransition { ...@@ -559,12 +559,12 @@ internal extension MotionTransition {
} }
processForMotionDelegate(viewController: tvc) { [weak self] in processForMotionDelegate(viewController: tvc) { [weak self] in
guard let s = self else { guard let `self` = self else {
return return
} }
$0.motion?(motion: s, willStartTransitionFrom: fvc) $0.motion?(motion: self, willStartTransitionFrom: fvc)
$0.motionWillStartTransition?(motion: s) $0.motionWillStartTransition?(motion: self)
} }
} }
......
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