Add a shake, bounce, or fade animation to any iOS app view in just two lines of Swift code
Set up animated views visually in Storyboard without writing any animation code
Chain animations together so one starts automatically when another finishes
Make a view animate automatically as soon as it appears on screen using Autostart
Drop the Spring folder into Xcode or add via CocoaPods, no other dependencies. Note: Autostart does not fire when arriving via performSegueWithIdentifier.
Spring is a Swift library that makes it easier to add animations to iOS apps. Instead of writing a lot of setup code yourself, you assign a named animation style to a view element and call a single method, and the library handles the motion. The library is compatible with Xcode 10 and Swift 4.2. You can use Spring in two ways. The first is through Storyboard, which is Xcode's visual interface editor: you connect a UIView element to the SpringView class using the Identity Inspector, then set animation properties visually in the Attribute Inspector without writing any code. The second way is to drive animations entirely from code, where you set the animation name and call animate() in just a few lines. The library ships with a named list of built-in animations, including shake, pop, morph, squeeze, wobble, swing, flipX, flipY, fall, various slide and squeeze directions, fade variants, and zoom and flash effects. Each animation can be adjusted with properties like duration, delay, force, damping, velocity, repeatCount, scale, position offsets, and rotation. You can also chain animations together so that one begins when another finishes, using the animateToNext function. Two convenience features are included. Autostart lets a view animate as soon as it appears on screen, with no extra code required. Autohide automatically sets a view opacity to zero in viewDidLoad, saving that line of manual setup. Installation is either by dropping the Spring folder directly into your Xcode project or by listing it as a pod in a CocoaPods Podfile. The README notes that animations will not autostart when a view is reached through performSegueWithIdentifier, which is a known limitation. Tutorial resources link to a Design+Code course. The library is released under the MIT license.
← mengto on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.