SwiftyAnimate alternatives and similar libraries
Based on the "Animation" category.
Alternatively, view SwiftyAnimate alternatives based on common mentions on social networks and blogs.
-
lottie-ios
An iOS library to natively render After Effects vector animations -
IBAnimatable
Design and prototype customized UI, interaction, navigation, transition and animation for App Store ready Apps in Interface Builder with IBAnimatable. -
SkeletonView
☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting -
ViewAnimator
ViewAnimator brings your UI to life with just one line -
AnimatedCollectionViewLayout
A UICollectionViewLayout subclass that adds custom transitions/animations to the UICollectionView without effecting your existing code. -
spruce-ios
Swift library for choreographing animations on the screen. -
EasyAnimation
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! -
Gemini
Gemini is rich scroll based animation framework for iOS, written in Swift. -
Presentation
:bookmark_tabs: Presentation helps you to make tutorials, release notes and animated pages. -
DKChainableAnimationKit
Easy to read and write chainable animations in Swift. -
Fluid Slider
:octocat:💧 A slider widget with a popup bubble displaying the precise value selected. Swift UI library made by @Ramotion -
YapAnimator
Your fast and friendly physics-based animation system. -
Interpolate
Swift interpolation for gesture-driven animations -
Sica
:deer: Simple Interface Core Animation. Run type-safe animation sequencially or parallelly -
ChainPageCollectionView
A custom View with fancy collectionView animation -
ZoomTransitioning
ZoomTransitioning provides a custom transition with image zooming animation and swiping the screen edge. -
navigation-toolbar
:octocat: Navigation toolbar is a slide-modeled UI navigation controller made by @Ramotion -
FlightAnimator
Advanced Natural Motion Animations, Simple Blocks Based Syntax -
CAROUSEL
List a collection of items in a horizontally scrolling view. A scaling factor controls the size of the items relative to the center. -
Garland View
:octocat: ≡ GarlandView seamlessly transitions between multiple lists of content. Swift UI library made by @Ramotion -
Animo
Bring life to CALayers with SpriteKit-like animation builders -
DSGradientProgressView
A simple animated progress bar in Swift -
SPPerspective
Widgets iOS 14 animation with 3D and dynamic shadow. Customisable transform and duration. -
TheAnimation
Type-safe CAAnimation wrapper. It makes preventing to set wrong type values. -
Walker
Each step you take reveals a new horizon. You have taken the first step today. -
SpriteKitEasingSwift
Better Easing for SpriteKit in Swift -
Poi
Poi makes you use card UI like tinder UI .You can use it like tableview method. -
DottedProgressBar
Simple and powerful animated progress bar with dots -
Numbers Animation
Numbers animation allows you to click on different numbers and accordingly it will animate numbers in a cool way. It has a very attractive UI and is very easy to use.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of SwiftyAnimate or a related project?
README
Composable animations in Swift. Blog
Installation
Cocoapods
The easiest way to get started is to use CocoaPods. Just add the following line to your Podfile:
pod 'SwiftyAnimate', '~> 1.3.0'
Carthage
github "rchatham/SwiftyAnimate"
Swift Package Manager
Add the following line to your Package.swift file.
.Package(url: "https://github.com/rchatham/SwiftyAnimate.git", majorVersion: 0)
Usage
This library can be used to design composable animations while keeping animation code readable and maintainable.
Composing Animations
Compose animations and insert logic inbetween them using the then
, do
, and wait
functions.
Then blocks
Add animations to the current instance using one of the implementations for this function. There are implemetations for spring and keyframe animations as well as chaining Animate
objects together.
Animate(duration: 1.0) {
// animation code goes here
}
.then(duration: 0.5) {
// more animation code
}
.perform()
And blocks
Add animations to the current instance using one of the implementations for this function. There are implemetations for spring and keyframe animations as well as stacking Animate
objects together. 'And' animations are performed in sync with the animation before it.
Animate(duration: 1.0) {
// animation code goes here
}
.and(duration: 0.5) {
// more animation code
}
.perform()
Do blocks
Add code that you don't intend on animating but would like to perform between animations here. Any code you put here will NOT be animated.
Animate(duration: 1.0) {
// animation code goes here
}
.do {
// logic you don't want to animate
}
.then(duration: 0.5) {
// more animation code
}
.perform()
Wait blocks
Add code that you may want to pause an ongoing chain of animations for. Any code you put here will NOT be animated. You can pass in a timeout if you want to wait for a specific amount of time or if you don't want to wait longer to execute the code in the wait block.
Animate(duration: 1.0) {
// animation code goes here
}
.wait(timeout: 5.0) { resume in
// logic you want to pause an animation to complete
resume()
}
.then(duration: 0.5) {
// more animation code
}
.perform()
Performing Animations
There are two ways to perform animations finish
and perform
. Important: You must either call one of these two functions or decay
on an animation instance or this will result in a memory leak!
Perform
This one is easy. Call this on an animation instance to perform it. Perform takes an optional closure which gets excecuted on completing the last animation block.
let animation = Animate(duration: 1.0) {
// animations
}
animation.perform()
Finish
If you don't need to pass in a completion closure try calling finish on your animation instance. The animation passed in is enqueue'd and then perform is called on the instance. Finish has all of the same variations as the then function.
Animate(duration: 1.0) {
// animations
}
.finish(duration: 1.0) {
// animations
}
Decay
If you would like to deallocate an animation instance without performing it call decay on it.
let animation = Animate(duration: 1.0) {
// animations
}
animation.decay()
UIView Extensions
A number of animatable properties have extensions defined to make implementing them with this library even easier. Please check the docs!
Best Practices
The best way to take advantage of this library is define extensions for the views that you would like to animate. This compartmentailizes your code and keep all the animation logic tucked up within the view and out of your view controllers.
extension AnimatingView {
func bounceAnimation() -> Animate {
return Animate()
.then(animation: scale(duration: 0.3, x: 1.3, y: 1.3))
.then(animation: scale(duration: 0.3, x: 0.8, y: 0.8))
.then(animation: scale(duration: 0.3, x: 1.1, y: 1.1))
.then(animation: scale(duration: 0.3, x: 1.0, y: 1.0))
}
}
Then when you go to perform an animation you just have to call perform()
on the returned animation.
let animatingView = AnimatingView()
animatingView.bounceAnimation().perform()
And string them together with other animations for building up complex animation logic easily.
Animate()
.then(animation: animatingView.bounceAnimation())
.then(animation: animatingView.tiltAnimation())
.then(animation: animatingView.bounceAnimation())
.perform()
Contributing
I would love to see your ideas for improving this library! The best way to contribute is by submitting a pull request. I'll do my best to respond to your patch as soon as possible. You can also submit a new GitHub issue if you find bugs or have questions. 🙏
Please make sure to follow our general coding style and add test coverage for new features!
*Note that all licence references and agreements mentioned in the SwiftyAnimate README section above
are relevant to that project's source code only.