GithubHelp home page GithubHelp logo

tchigher / spring Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mengto/spring

0.0 0.0 0.0 925 KB

A library to simplify iOS animations in Swift.

Home Page: http://designcode.io

License: MIT License

Ruby 0.48% Swift 99.14% Objective-C 0.39%

spring's Introduction

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.

spring's People

Contributors

0oneo avatar attilaszasz avatar brandonminch avatar chohey avatar giacomopiva avatar giolin avatar hamzaansari09 avatar imkevinxu avatar jaisonv avatar jakemanning avatar jamztang avatar jasdev avatar jpachecou avatar jpwharton avatar larryaasen avatar mengto avatar naoyashiga avatar nolanw avatar pglongo avatar phatmann avatar rastersize avatar rcgary avatar ricardopereira avatar rishabhtayal avatar schneiderandre avatar shoheiyokoyama avatar thedoritos avatar victors1681 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.