A library to simplify iOS animations in Swift.

Related tags

Animation Spring
Overview

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.

Comments
  • Animation doesn't work when the View Controller is pushed through Navigation Controller.

    Animation doesn't work when the View Controller is pushed through Navigation Controller.

    I have tested this by creating a test project and applying animation to UIButtons. The root view controller's button animates while the UIButton in next view controller(which is pushed after first button is pressed) does not animate. Both buttons have same SpringButton properties.

    I am trying to animating through storyboard.

    help wanted 
    opened by RishabhTayal 20
  • Carthage support

    Carthage support

    Supporting Cocoapods (http://cocoapods.org) and/or Carthage (https://github.com/Carthage/Carthage) is great for libraries. It might not be the easiest thing for "new comers", but for the rest is a must

    help wanted 
    opened by raulriera 16
  • setValue:forUndefinedKey

    setValue:forUndefinedKey

    2015-03-03 19:55:52.507 demos[24988:4604020] Failed to set (animation) user defined inspected property on (UIView): [<UIView 0x7a8860b0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key animation.
    
    
    opened by aliencode 14
  • CGBlendMode.Type' does not have a member named 'Normal'

    CGBlendMode.Type' does not have a member named 'Normal'

    I'm currently running Swift 2, with Xcode 7 and using the swift2 branch of Spring. Upon building the project I am given this error

    /Desktop/Swift/Dynamic/Pods/Spring/Spring/DesignableTabBarController.swift:110:40: 'CGBlendMode.Type' does not have a member named 'Normal'
    

    Any ideas? I've already tried building and cleaning.

    opened by ghost 11
  • is unavailable: cannot find Swift declaration for this class

    is unavailable: cannot find Swift declaration for this class

    Hi,

    When I building my app in simulator, everything is working, but when I want to build app on device I get errors that different Spring classes declarations cannot been found, can you help me?

    opened by IcooN 10
  • Back button does not nothing

    Back button does not nothing

    I'm starting the Tutorial from your book but I've imported the Spring framework to the project and when I've set the segue to "unwindToViewController" and Run the project, the Back button does nothing....Please help me ;) Regards,

    Álvaro.

    opened by alvagorn 8
  • Swift Compiler Error

    Swift Compiler Error

    Didn't have this problem last night. Not sure what cause this? Help, please.

    /Spring-master/Spring/LoadingView.swift /Spring-master/Spring/LoadingView.swift:40:99: 'AnyObject' is not convertible to 'UIView'; did you mean to use 'as!' to force downcast? /Spring-master/Spring/Misc.swift /Spring-master/Spring/Misc.swift:26:37: 'countElements' has been renamed to count /Spring-master/Spring/Misc.swift:75:21: 'countElements' has been renamed to count /Spring-master/Spring/DesignableTabBarController.swift /Spring-master/Spring/DesignableTabBarController.swift:36:35: 'selectedImageTintColor' was deprecated in iOS version 8.0: Use tintColor /Spring-master/Spring/DesignableTabBarController.swift:49:46: '?' must be followed by a call, member lookup, or subscript /Spring-master/Spring/DesignableTabBarController.swift:50:53: '[AnyObject]?' is not convertible to '[UITabBarItem]'; did you mean to use 'as!' to force downcast? /Spring-master/Spring/DesignableTabBarController.swift:58:47: '?' must be followed by a call, member lookup, or subscript /Spring-master/Spring/DesignableTabBarController.swift:59:53: '[AnyObject]?' is not convertible to '[UITabBarItem]'; did you mean to use 'as!' to force downcast? /Spring-master/Spring/DesignableTabBarController.swift:67:46: '?' must be followed by a call, member lookup, or subscript /Spring-master/Spring/DesignableTabBarController.swift:68:53: '[AnyObject]?' is not convertible to '[UITabBarItem]'; did you mean to use 'as!' to force downcast? /Spring-master/Spring/DesignableTabBarController.swift:76:47: '?' must be followed by a call, member lookup, or subscript /Spring-master/Spring/DesignableTabBarController.swift:77:53: '[AnyObject]?' is not convertible to '[UITabBarItem]'; did you mean to use 'as!' to force downcast? /Spring-master/Spring/DesignableTabBarController.swift:85:46: '?' must be followed by a call, member lookup, or subscript /Spring-master/Spring/DesignableTabBarController.swift:86:53: '[AnyObject]?' is not convertible to '[UITabBarItem]'; did you mean to use 'as!' to force downcast? /Spring-master/Spring/DesignableTabBarController.swift:95:39: '[AnyObject]?' is not convertible to '[UITabBarItem]'; did you mean to use 'as!' to force downcast? /Spring-master/Spring/Spring.swift /Spring-master/Spring/Spring.swift:450:35: Missing argument label 'completion:' in call

    opened by ajthechan 7
  • Designable: Build Fail

    Designable: Build Fail

    I just bought your book and going through v1. Great job, and so far so good.

    I do have an issue with Spring though. I've installed through dragging it into xCode and have checked both "copy files if required" and "create group". But, when I try to use it, it says Designable: Build Fail. I've tried your test SpringApp, and it worked, but not for my own app that I'm building. Any idea?

    @MengTo

    opened by ervintwj 6
  • SpringAnimation for OC lover

    SpringAnimation for OC lover

    Reason

    The SpringAnimation.swift doesn't support for objective-c.

    Resolution

    Create a OC model that have same function as SpringAnimation.

    I bought the book BTW :DDD

    opened by LawrenceHan 6
  • LoadingView.xib missing?

    LoadingView.xib missing?

    I'm using CocoaPods to integrate Spring, but the app crashes when calling view.showLoading( ): "Could not load NIB in bundle...with name 'LoadingView'"

    Could this be because LoadingView.xib is not included in the podspec? I'm new to CocoaPods, but the podspec has: "s.source_files = 'Spring/.swift' " -- should there also be: ",.xib" ?

    Thanks

    opened by frizzy75 6
  • prevents retain cycle

    prevents retain cycle

    based on what I said here:

    https://github.com/MengTo/Spring/issues/16

    The views were retaining the Spring, and the Spring was also retaining the view.

    opened by camovb 6
  • Feature/easy animation

    Feature/easy animation

    I added a no-fuss convenience method for animating any Springable adhering object - just by specifying the animation type as a parameter instead of first needing to set the .animation property as a string. It includes an optional completion handler and a basic test.

    I am not sure if this project is still maintained but as I used this for my project I thought I would pull-request it. Cheers!

    opened by jjvarghese 0
  • Fix redundant `public` statements and prefer `let` over `var`

    Fix redundant `public` statements and prefer `let` over `var`

    This should resolve unnecessary compiler warnings over "reduntant public declaration" or "use let instead of var for non-mutating variables".

    opened by Sebastian-Hojas 0
A Swift library to take the power of UIView.animateWithDuration(_:, animations:...) to a whole new level - layers, springs, chain-able animations and mixing view and layer animations together!

ver 2.0 NB! Breaking changes in 2.0 - due to a lot of requests EasyAnimation does NOT automatically install itself when imported. You need to enable i

Marin Todorov 3k Dec 27, 2022
(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing.

wobbly See Wobbly in action (examples) Add a drop of honey ?? to your project wobbly has a bunch of cool, fun, and easy to use iOS animations for you

Sagaya Abdulhafeez 150 Dec 23, 2021
(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing.

wobbly See Wobbly in action (examples) Add a drop of honey ?? to your project wobbly has a bunch of cool, fun, and easy to use iOS animations for you

Sagaya Abdulhafeez 150 Dec 23, 2021
A collection of animations for iOS. Simple, just add water animations.

DCAnimationKit A collection of animations for iOS Simply, just add water! DCAnimationKit is a category on UIView to make animations easy to perform. E

Dalton 797 Sep 23, 2022
An iOS library to natively render After Effects vector animations

Lottie for iOS, macOS (and Android and React Native) View documentation, FAQ, help, examples, and more at airbnb.io/lottie Lottie is a mobile library

Airbnb 23.6k Dec 31, 2022
A library of custom iOS View Controller Animations and Interactions.

RZTransitions is a library to help make iOS7 custom View Controller transitions slick and simple. Installation CocoaPods (Recommended) Add the followi

Rightpoint 1.9k Nov 20, 2022
A library for fancy iOS animations that you will definitely love.

EazelAnimationsKit Table of Contents Introduction Animations Usage Installation Contribution Authors Introduction The drive for developing this animat

Eazel 7 Dec 13, 2022
Swift library for choreographing animations on the screen.

Spruce iOS Animation Library (and Android) What is it? Spruce is a lightweight animation library that helps choreograph the animations on the screen.

WillowTree, LLC 3.4k Jan 3, 2023
SamuraiTransition is an open source Swift based library providing a collection of ViewController transitions featuring a number of neat “cutting” animations.

SamuraiTransiton is a ViewController transition framework in Swift. It is an animation as if Samurai cut out the screen with a sword. transition types

hachinobu 273 Dec 29, 2022
This repo contains swift collection of gui, games, menu, animations, music, payment, etc... for iOS, macOS, watchOS and tvOS

Swift-Collections About: This repo contains a collection of projects built using swift and objective-c Contains projects for macOS iOS iPad watchOS tv

Krisna Pranav 6 Nov 15, 2022
Physics-based animations for iOS, tvOS, and macOS.

Advance An animation library for iOS, tvOS, and macOS that uses physics-based animations (including springs) to power interactions that move and respo

Tim Donnelly 4.5k Dec 29, 2022
Sample way of integrating animations into a design system for iOS app projects.

Animations in Design System The project presents a sample way of integrating animations into a design system for iOS developers. Project setup A sampl

Bulat Khabirov 1 Nov 26, 2021
Easily build advanced custom animations on iOS.

INTUAnimationEngine makes it easy to build advanced custom animations on iOS. INTUAnimationEngine provides a friendly interface to drive custom animat

Intuit 1.1k Dec 14, 2022
MotionBlur allows you to add motion blur effect to iOS animations.

MotionBlur MotionBlur allows you to add motion blur effect to your animations (currently only position's change). See the accompanying blog post to le

Arek Holko 1.5k Nov 3, 2022
Wave is a spring-based animation engine for iOS that makes it easy to create fluid, interruptible animations that feel great.

Wave is a spring-based animation engine for iOS and iPadOS. It makes it easy to create fluid, interactive, and interruptible animations that feel great.

Janum Trivedi 1.2k Jan 8, 2023
Stagehand provides a modern, type-safe API for building animations on iOS

Stagehand Stagehand provides a modern, type-safe API for building animations on iOS. Stagehand is designed around a set of core ideas: Composition of

Cash App 118 Dec 3, 2022
iOS framework for impressive transition animations between views.

CoreTransition iOS framework for impressive transition animations between views. Built using Swift, and supports a lot of animations to navigate to a

Ahmed Abdelkarim 4 Nov 17, 2022
Swift interpolation for gesture-driven animations

Interpolate Interpolate is a powerful Swift interpolation framework for creating interactive gesture-driven animations. Usage The ?? idea of Interpola

Roy Marmelstein 1.8k Dec 20, 2022
Composable animations in Swift

Composable animations in Swift. Blog Installation Cocoapods The easiest way to get started is to use CocoaPods. Just add the following line to your Po

Reid Chatham 195 Dec 5, 2022