Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Dahan committed Feb 8, 2018
1 parent d740828 commit 654928d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Motion.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Motion'
s.version = '1.3.4'
s.version = '1.3.5'
s.license = 'MIT'
s.summary = 'A library used to create beautiful animations and transitions for Apple devices.'
s.homepage = 'http://cosmicmind.com'
Expand Down
32 changes: 16 additions & 16 deletions Sources/Extensions/Motion+CALayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ fileprivate extension CALayer {
ts = ts,
completion = completion] in

guard let s = self else {
guard let `self` = self else {
return
}

Expand All @@ -208,31 +208,31 @@ fileprivate extension CALayer {

if let v = ts.backgroundColor {
let a = MotionCAAnimation.background(color: UIColor(cgColor: v))
a.fromValue = s.backgroundColor
a.fromValue = self.backgroundColor
anims.append(a)
}

if let v = ts.borderColor {
let a = MotionCAAnimation.border(color: UIColor(cgColor: v))
a.fromValue = s.borderColor
a.fromValue = self.borderColor
anims.append(a)
}

if let v = ts.borderWidth {
let a = MotionCAAnimation.border(width: v)
a.fromValue = NSNumber(floatLiteral: Double(s.borderWidth))
a.fromValue = NSNumber(floatLiteral: Double(self.borderWidth))
anims.append(a)
}

if let v = ts.cornerRadius {
let a = MotionCAAnimation.corner(radius: v)
a.fromValue = NSNumber(floatLiteral: Double(s.cornerRadius))
a.fromValue = NSNumber(floatLiteral: Double(self.cornerRadius))
anims.append(a)
}

if let v = ts.transform {
let a = MotionCAAnimation.transform(v)
a.fromValue = NSValue(caTransform3D: s.transform)
a.fromValue = NSValue(caTransform3D: self.transform)
anims.append(a)
}

Expand All @@ -252,55 +252,55 @@ fileprivate extension CALayer {

if let v = ts.position {
let a = MotionCAAnimation.position(v)
a.fromValue = NSValue(cgPoint: s.position)
a.fromValue = NSValue(cgPoint: self.position)
anims.append(a)
}

if let v = ts.opacity {
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)
}

if let v = ts.zPosition {
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)
}

if let v = ts.size {
let a = MotionCAAnimation.size(v)
a.fromValue = NSValue(cgSize: s.bounds.size)
a.fromValue = NSValue(cgSize: self.bounds.size)
anims.append(a)
}

if let v = ts.shadowPath {
let a = MotionCAAnimation.shadow(path: v)
a.fromValue = s.shadowPath
a.fromValue = self.shadowPath
anims.append(a)
}

if let v = ts.shadowColor {
let a = MotionCAAnimation.shadow(color: UIColor(cgColor: v))
a.fromValue = s.shadowColor
a.fromValue = self.shadowColor
anims.append(a)
}

if let v = ts.shadowOffset {
let a = MotionCAAnimation.shadow(offset: v)
a.fromValue = NSValue(cgSize: s.shadowOffset)
a.fromValue = NSValue(cgSize: self.shadowOffset)
anims.append(a)
}

if let v = ts.shadowOpacity {
let a = MotionCAAnimation.shadow(opacity: v)
a.fromValue = NSNumber(floatLiteral: Double(s.shadowOpacity))
a.fromValue = NSNumber(floatLiteral: Double(self.shadowOpacity))
anims.append(a)
}

if let v = ts.shadowRadius {
let a = MotionCAAnimation.shadow(radius: v)
a.fromValue = NSNumber(floatLiteral: Double(s.shadowRadius))
a.fromValue = NSNumber(floatLiteral: Double(self.shadowRadius))
anims.append(a)
}

Expand All @@ -326,7 +326,7 @@ fileprivate extension CALayer {
g.isRemovedOnCompletion = false
g.timingFunction = ts.timingFunction

s.animate(g)
self.animate(g)

if let v = ts.completion {
Motion.delay(duration, execute: v)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.3.4</string>
<string>1.3.5</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
6 changes: 3 additions & 3 deletions Sources/Transition/MotionTransition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -559,12 +559,12 @@ internal extension MotionTransition {
}

processForMotionDelegate(viewController: tvc) { [weak self] in
guard let s = self else {
guard let `self` = self else {
return
}

$0.motion?(motion: s, willStartTransitionFrom: fvc)
$0.motionWillStartTransition?(motion: s)
$0.motion?(motion: self, willStartTransitionFrom: fvc)
$0.motionWillStartTransition?(motion: self)
}
}

Expand Down

0 comments on commit 654928d

Please sign in to comment.