Skip to content
A library to simplify iOS animations in Swift.
Swift Other
  1. Swift 99.1%
  2. Other 0.9%
Branch: master
Clone or download
MengTo Merge pull request #333 from trongnhan68/master
Upgrade  code to support swift 5
Latest commit 50d92a5 Aug 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Spring Upgrade to swift 5 Jul 26, 2019
SpringApp.xcodeproj Upgrade to swift 5 Jul 26, 2019
SpringApp Swift 4 Jun 16, 2017
SpringAppTests swift 3.0 convert Jun 22, 2016
SpringTests swift 3.0 convert Jun 22, 2016
.gitignore Exclude .DS_Store from .gitignore Jan 15, 2015
.swift-version cocoapods 1.0.4 with Swift 4 Dec 20, 2017
LICENSE Added MIT License. Fixes #8 Feb 1, 2015
README.md Update README.md Oct 3, 2018
Spring.podspec Update Spring.podspec Oct 10, 2018

README.md

Updated for Swift 4.2

Requires Xcode 10 and Swift 4.2.

Installation

Drop in the Spring folder to your Xcode project (make sure to enable "Copy items if needed" and "Create groups").

Or via CocoaPods:

use_frameworks!
pod 'Spring', :git => 'https://github.com/MengTo/Spring.git'

Usage with Storyboard

In Identity Inspector, connect the UIView to SpringView Class and set the animation properties in Attribute Inspector.

Usage with Code

layer.animation = "squeezeDown"
layer.animate()

Demo The Animations

Chaining Animations

layer.y = -50
animateToNext {
  layer.animation = "fall"
  layer.animateTo()
}

Functions

animate()
animateNext { ... }
animateTo()
animateToNext { ... }

Animation

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

Curve

spring
linear
easeIn
easeOut
easeInOut

Properties

force
duration
delay
damping
velocity
repeatCount
scale
x
y
rotate

* Not all properties work together. Play with the demo app.

Autostart

Allows you to animate without code. Don't need to use this if you plan to start the animation in code.

Autohide

Saves you the hassle of adding a line "layer.alpha = 0" in viewDidLoad().

Known issue

Animations won't autostart when view is reached via performSegueWithIdentifier.

Tutorials

ChangeLog

License

Spring is released under the MIT license. See LICENSE for details.

You can’t perform that action at this time.