Anima alternatives and similar libraries
Based on the "Animation" category.
Alternatively, view Anima alternatives based on common mentions on social networks and blogs.
-
Lottie
An iOS library for a real time rendering of native vector animations from Adobe After Effects. -
AnimatedCollectionViewLayout
A UICollectionViewLayout subclass that adds custom transitions/animations to the UICollectionView. -
Spruce iOS Animation Library
Swift library for choreographing animations on the screen. -
Gemini
Gemini is rich scroll based animation framework for iOS, written in Swift -
DeckTransition
A library to recreate the iOS Apple Music now playing transition -
Transition
Easy interactive interruptible custom ViewController transitions. -
Sica
Simple Interface Core Animation. Run type-safe animation sequencially or parallelly. -
Gagat
A delightful way to transition between visual styles in your iOS applications. -
TransitionableTab
TransitionableTab makes it easy to animate when switching between tab -
AlertTransition
AlertTransition is a extensible library for making view controller transitions, especially for alert transitions. -
anim
An animation library for iOS with custom easings and easy to follow API. -
YetAnotherAnimationLibrary
Designed for gesture-driven animations. Fast, simple, & extensible!. -
SwipeTransition
Allows trendy transitions using swipe gesture such as "swipe back". -
AKVideoImageView
UIImageView subclass which allows you to display a looped video as a background. -
TheAnimation
Type-safe CAAnimation wrapper. It makes preventing to set wrong type values. -
AGInterfaceInteraction
library performs interaction with UI interface. -
Poi
Poi makes you use card UI like tinder UI .You can use it like tableview method. -
Disintegrate
Disintegration animation inspired by THAT thing Thanos did at the end of Avengers: Infinity War. -
CircularRevealKit
UI framework that implements the material design's reveal effect. -
Kinieta
An Animation Engine with Custom Bezier Easing, an Intuitive API and perfect Color Intepolation. -
VariousViewsEffects
Animates views nicely with easy to use extensions.
Scout APM - Leading-edge performance monitoring starting at $39/month
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of Anima or a related project?
README
Anima
Anima is chainable Layer-Based Animation library for Swift5. It support to make sequensial and grouped animation more easily.
is written as follows.
let startAnimations: [AnimaType] = [.moveByY(-50), .rotateByZDegree(90)]
let moveAnimations: [AnimaType] = [.moveByX(50), .rotateByZDegree(90)]
let endAnimations: [AnimaType] = [.moveByY(-50), .rotateByZDegree(90)]
animaView.layer.anima
.then(.opacity(1.0))
.then(group: startAnimations)
.then(group: moveAnimations, options: labelAnimaOption(index: 0))
.then(group: moveAnimations, options: labelAnimaOption(index: 1))
.then(group: moveAnimations, options: labelAnimaOption(index: 2))
.then(group: moveAnimations, options: labelAnimaOption(index: 3))
.then(group: endAnimations, options: labelAnimaOption(index: 4))
.then(group: [.scaleBy(0.0), .opacity(0.0)])
func labelAnimaOption(index: Int) -> [AnimaOption] {
let labelAnima = labels[index]?.layer.anima
return [.completion({
labelAnima?.then(.opacity(1)).fire()
})]
}
Requirements
Anima require for Swift4 and greater than iOS9.0📱
Features
- Almost all timing modes from easings.set are implemented.
- Spring Animation ( featured by CASpringAnimation )
- Type-Safed Animation KeyPath ()
Usage
Move Position
If you want to translate CALayer.position
relatively, use .moveByX(CGFloat)
, .moveByY(CGFloat)
, .moveByXY(x: CGFloat, y: CGFloat)
AnimaTypes.
layer.anima.then(.moveByX(50)).fire()
or destination is determined, use .moveTo(x: CGFloat, y: CGFloat)
.
※ Anima doesn't update CALayer.position
value for animations. Because when update Layer-backed view's layer position value, It will be resetted to default value frequently.
Sequential Animation
Anima supports.
Group Animation
To run animation concurrently, you use CAAnimationGroup
with CoreAnimation.
In Anima, you can use Anima.then(group: )
to run some AnimaType
concurrently.
Below is an example of how to run moving, scaling and rotating animations concurrently.
layer.anima
.then(group: [.moveByX(200),
.scaleBy(1.5),
.rotateByZDegree(180)])
.fire()
Animation Options
There are some options for Anima.
- duration(TimeInterval)
- timingFunction(TimingFunction)
_ Change timing function defining the pacing of the animation.
_ Default timing function is at
Anima.defaultTimingFunction
. If you do not set the timing function option, defaultTimingFunction is used. * Please readAnima.TimingFunction.swift
- repeat(count: Float) * To run animation infinitely, set
.infinity
. - autoreverse
- completion(() -> Void)
you can use these values as belows.
layer
.anima
.then(.moveByX(100), options: [.autoreverse,
.timingFunciton(.easeInQuad),
.repeat(count: 3),
.completion({
print("completion")
})])
.fire()
Rotate Animation & AnchorPoint
AnimaType has 3 rotation animation type, .rotateByX
, .rotateByY
, .rotateByZ
.
and each animation type has 2 value types, degrees
and radians
.
you use whichever you like.
and CALayer has AnchorPoint
. Rotating, moving, or other Animations are affected by it. Default value is (0.5, 0.5).
AnimaType.moveAnchor(AnimaAnchorPoint)
can move layer's AnchorPoint.
layer.anima
.then(.rotateByZDegree(360))
.then(.moveAnchor(.topLeft))
.then(.rotateByZDegree(360))
.fire()
or If you want to change only AnchorPoint, use Anima.then(setAnchor: AnimaAnchorPoint)
.
layer.anima
.then(.rotateByZDegree(360))
.then(setAnchor: .topLeft)
.then(.rotateByZDegree(360))
.fire()
Move Path
If you want to make moving animation more complex, use .movePath(path: CGPath, keyTymes: [Double])
.
Anima example app has sample of creating animation by drag gesture. you see it!
but It has any problems when you use with AnimaOption.autoreverse
.
so If you use it, please be careful of options.
Original KeyPath
If you want to animate other animatable values, You can use AnimaType.original(keyPath: String, from: Any?, to: Any)
for it.
CAEmitterLayer
's animation is like this.
let layer = CAEmitterLayer()
layer.emitterPosition = CGPoint(x: 100.0, y:100.0)
layer.anima
.then(.original(keyPath: #keyPath(CAEmitterLayer.emitterPosition), from: layer.emitterPosition, to: CGPoint(x: 200.0, y:200.0)))
.fire()
Example
To run the example project, clone the repo, open Anima.xcodeproj
, and run target Anima iOS Example
.
Installation
Cocoapods
Anima is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "Anima"
# If you want to use Swift 3 version, Please specify Anima version.
pod "Anima", "0.5.1"
Carthage
Add github satoshin21/Anima
to your Cartfile
.
Execute carthage update to install it.
Author
Satoshi Nagasaka, [email protected]
License
Anima is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the Anima README section above
are relevant to that project's source code only.