Skip to content

githubdrk/Spring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

Drag and drop the Spring folder to your Xcode project.

* If you don't need all extra stuff, just drop Spring/SpringView.swift to your Xcode project.

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()

Chaining Animations

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

Presets

    "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
scale
x
y
rotate

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

About

A library to simplify iOS animations in Swift.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 99.1%
  • Other 0.9%