explaingit

mengto/spring

14,043SwiftAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A Swift library for iOS that lets you add animations to any view by naming a style and calling one method, no boilerplate, works from Storyboard or pure code.

Mindmap

mindmap
  root((spring))
    What it does
      Named animations
      One-method call
      Storyboard support
    Animation types
      Shake pop morph
      Slide fade zoom
      Flip wobble swing
    Configuration
      Duration delay
      Force damping
      Chain animations
    Installation
      Drop-in folder
      CocoaPods pod
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add a shake, bounce, or fade animation to any iOS app view in just two lines of Swift code

USE CASE 2

Set up animated views visually in Storyboard without writing any animation code

USE CASE 3

Chain animations together so one starts automatically when another finishes

USE CASE 4

Make a view animate automatically as soon as it appears on screen using Autostart

Tech stack

SwiftCocoaPodsXcode

Getting it running

Difficulty · easy Time to first run · 30min

Drop the Spring folder into Xcode or add via CocoaPods, no other dependencies. Note: Autostart does not fire when arriving via performSegueWithIdentifier.

Use freely for any purpose, including commercial projects, as long as you keep the copyright notice.

In plain English

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.

Copy-paste prompts

Prompt 1
I'm building an iOS app in Swift. How do I add a wobble animation to a UIButton using the Spring library? Show me the minimal setup code.
Prompt 2
Using Spring for iOS, how do I chain a fade-in followed by a slide-up on the same view using animateToNext?
Prompt 3
How do I install the Spring animation library via CocoaPods and animate a UIImageView with a pop effect on tap?
Prompt 4
Show me how to set Spring animation properties like duration, damping, and force in a Storyboard Attribute Inspector without writing code.
Open on GitHub → Explain another repo

← mengto on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.