Requires Xcode 10 and Swift 4.2.
Spring can be installed through the following options.
Drop in the Spring folder to your Xcode project (make sure to enable "Copy items if needed" and "Create groups").
use_frameworks!
pod 'Spring', :git => 'https://github.com/MengTo/Spring.git'
From inside Xode go to File -> Swift Packages -> Add Package Dependency and paste 'https://github.com/MengTo/Spring.git' into the top field.
Alternatively you can add the following inside your Package.swift file:
dependencies: [
.package(url: "https://github.com/MengTo/Spring.git", from: "1.0.6")
]
In Identity Inspector, connect the UIView to SpringView Class and set the animation properties in Attribute Inspector.
layer.animation = "squeezeDown"
layer.animate()
layer.y = -50
animateToNext {
layer.animation = "fall"
layer.animateTo()
}
animate()
animateNext { ... }
animateTo()
animateToNext { ... }
shake
pop
morph
squeeze
wobble
swing
flipX
flipY
fall
squeezeLeft
squeezeRight
squeezeDown
squeezeUp
slideLeft
slideRight
slideDown
slideUp
fadeIn
fadeOut
fadeInLeft
fadeInRight
fadeInDown
fadeInUp
zoomIn
zoomOut
flash
spring
linear
easeIn
easeOut
easeInOut
force
duration
delay
damping
velocity
repeatCount
scale
x
y
rotate
* Not all properties work together. Play with the demo app.
Allows you to animate without code. Don't need to use this if you plan to start the animation in code.
Saves you the hassle of adding a line "layer.alpha = 0" in viewDidLoad().
Animations won't autostart when view is reached via performSegueWithIdentifier.
- Tutorials available on Design+Code.
- Integrate Spring to existing Objective-C projects
- At ChangeLog wiki page
Spring is released under the MIT license. See LICENSE for details.