This is a lightweight version of Meng To's Spring animation library with just the necessary files for animations and easy drop-in for any Swift project.
Drop in the Spring
folder to your Xcode project.
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 { ... }
slideLeft
slideRight
slideDown
slideUp
squeezeLeft
squeezeRight
squeezeDown
squeezeUp
zoomIn
zoomOut
fadeIn
fadeOut
fadeInLeft
fadeInRight
fadeInDown
fadeInUp
fall
rotate
heartBeat
pulse
shake
pop
swing
morph
squeeze
wobble
flash
flipX
flipY
spring
linear
easeIn
easeOut
easeInOut
animation
curve
autostart
autohide
delay
duration
force
damping
velocity
rotateDegrees
repeatCount
x
y
scaleX
scaleY
rotate
* Not all properties work together. Play with the demo app.
Allows you to animate without code. Don't need to use this is 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.
Animations using IBInspectables are currently not working in iOS 7. iOS 8 is supported. We're looking for a fix. Animations in code works for both iOS 7 and 8.
- 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.