Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MengTo/Spring
A library to simplify iOS animations in Swift.
https://github.com/MengTo/Spring
Last synced: 3 days ago
JSON representation
A library to simplify iOS animations in Swift.
- Host: GitHub
- URL: https://github.com/MengTo/Spring
- Owner: MengTo
- License: mit
- Created: 2014-12-26T14:57:02.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-07-03T14:28:34.000Z (over 1 year ago)
- Last Synced: 2024-12-03T00:04:34.443Z (9 days ago)
- Language: Swift
- Homepage: http://designcode.io
- Size: 903 KB
- Stars: 14,084
- Watchers: 466
- Forks: 1,805
- Open Issues: 165
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - Spring - A library to simplify iOS animations in Swift. (UI / Animation)
- awesome-swift - Spring - A library to simplify iOS animations. (Libs / Animation)
- awesome-swift - Spring - A library to simplify iOS animations. (Libs / Animation)
- fucking-awesome-swift - Spring - A library to simplify iOS animations. (Libs / Animation)
- awesome-ios-star - Spring - A library to simplify iOS animations in Swift. (UI / Animation)
- awesome-github-star - Spring
- awesome-ios-1 - MengTo / Spring
- awesome-swift-cn - Spring - A library to simplify iOS animations in Swift. (Libs / Animation)
- awesome-swift-and-tutorial-resources - Spring
- awesome-swift - Spring - A library to simplify iOS animations in Swift. ` 📝 2 years ago ` (Animation [🔝](#readme))
README
## 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.![](http://cl.ly/image/241o0G1G3S36/download/springsetup.jpg)
## Usage with Code
layer.animation = "squeezeDown"
layer.animate()## Demo The Animations
![](http://cl.ly/image/1n1E2j3W3y24/springscreen.jpg)## 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
- Tutorials available on [Design+Code](https://designcode.io/swiftapp).
- [Integrate Spring to existing Objective-C projects](https://medium.com/ios-apprentice/using-swift-in-objective-c-projects-f7e7a09f8be)## ChangeLog
- At [ChangeLog](https://github.com/MengTo/Spring/wiki/CHANGELOG) wiki page## License
Spring is released under the MIT license. See LICENSE for details.