diff --git a/SpriteKit-Spring.podspec b/SpriteKit-Spring.podspec index 587acb3..36d29fe 100644 --- a/SpriteKit-Spring.podspec +++ b/SpriteKit-Spring.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |s| s.name = "SpriteKit-Spring" - s.version = "1.0.1" + s.version = "1.1.0" s.summary = "SpriteKit API reproducing UIView's spring animations with SKAction" s.homepage = "https://github.com/ataugeron/SpriteKit-Spring" s.screenshots = "https://ataugeron.github.io/SpriteKit-Spring/bounce_1.gif", "https://ataugeron.github.io/SpriteKit-Spring/bounce_2.gif", "https://ataugeron.github.io/SpriteKit-Spring/bounce_3.gif" diff --git a/SpriteKit-Spring.swift b/SpriteKit-Spring.swift index 8c55c1c..a399242 100644 --- a/SpriteKit-Spring.swift +++ b/SpriteKit-Spring.swift @@ -244,7 +244,7 @@ public extension SKAction { if initialValue == nil { initialValue = node.value(forKeyPath: keyPath) as! CGFloat - initialDistance = initialDistance ?? finalValue - initialValue! + initialDistance = initialDistance != nil ? initialDistance * initialValue - initialValue : finalValue - initialValue! finalValue = finalValue ?? initialValue! + initialDistance var magicNumber: CGFloat! // picked manually to visually match the behavior of UIKit