CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.
TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Oct 2017 |
Maintained by Nik Burnt.
This library was created for general usage when keyframe animations used and key values can't be easily interpolated thru animation progress.
Here is the list of available easing functions:
In | Out | InOut | OutIn | |
---|---|---|---|---|
Linear | ![]() |
![]() |
![]() |
![]() |
Sinusoidal | ![]() |
![]() |
![]() |
![]() |
Quadratic | ![]() |
![]() |
![]() |
![]() |
Cubic | ![]() |
![]() |
![]() |
![]() |
Quartic | ![]() |
![]() |
![]() |
![]() |
Quintic | ![]() |
![]() |
![]() |
![]() |
Exponential | ![]() |
![]() |
![]() |
![]() |
Circular | ![]() |
![]() |
![]() |
![]() |
Back | ![]() |
![]() |
![]() |
![]() |
Bounce | ![]() |
![]() |
![]() |
![]() |
Elastic | ![]() |
![]() |
![]() |
![]() |
This library can be used in two ways: OOP and functional.
In the first case easing function represents one of the next objects instance(they all are childs of ESQEasingFunction
):
ESQLinearEasingFunction
ESQSinusoidalEasingFunction
ESQQuadraticEasingFunction
ESQCubicEasingFunction
ESQQuarticEasingFunction
ESQQuinticEasingFunction
ESQExponentialEasingFunction
ESQCircularEasingFunction
ESQBackEasingFunction
ESQBounceEasingFunction
ESQElasticEasingFunction
Those object can be instantiated in the few ways:
ESQEasingFunctionTypeOut
) and parametersCGFloat progress = ...
ESQEasingFunction *easingFunction = [[ESQElasticEasingFunction alloc] init];
CGFloat easedProgress = [easingFunction easedProgress:progress];
CGFloat progress = ...
ESQEasingFunction *easingFunction = [ESQElasticEasingFunction easingFunctionWithType:ESQEasingFunctionTypeInOut];
CGFloat easedProgress = [easingFunction easedProgress:progress];
CGFloat customAmplitude = ...
CGFloat progress = ...
ESQEasingFunction *easingFunction = [ESQElasticEasingFunction easingFunctionWithType:ESQEasingFunctionTypeInOut amplitude:customAmplitude period:ESQDefaultElasticPeriod];
CGFloat easedProgress = [easingFunction easedProgress:progress];
Also, if you preffer funcitons or need more perfomance you may use easing functions which can provide the same results as using objects. Here is the list of all available easing funcitons:
In | Out | InOut | OutIn | |
---|---|---|---|---|
Linear | linearIn(p) |
linearOut(p) |
linearInOut(p) |
linearOutIn(p) |
Sinusoidal | sinusoidalIn(p) |
sinusoidalOut(p) |
sinusoidalInOut(p) |
sinusoidalOutIn(p) |
Quadratic | quadraticIn(p) |
quadraticOut(p) |
quadraticInOut(p) |
quadraticOutIn(p) |
Cubic | cubicIn(p) |
cubicOut(p) |
cubicInOut(p) |
cubicOutIn(p) |
Quartic | quarticIn(p) |
quarticOut(p) |
quarticInOut(p) |
quarticOutIn(p) |
Quintic | quinticIn(p) |
quinticOut(p) |
quinticInOut(p) |
quinticOutIn(p) |
Exponential | exponentialIn(p) |
exponentialOut(p) |
exponentialInOut(p) |
exponentialOutIn(p) |
Circular | circularIn(p) |
circularOut(p) |
circularInOut(p) |
circularOutIn(p) |
Back | backIn(p, o) |
backOut(p, o) |
backInOut(p, o) |
backOutIn(p, o) |
Bounce | bounceIn(p, o) |
bounceOut(p, o) |
bounceInOut(p, o) |
bounceOutIn(p, o) |
Elastic | elasticIn(p, a, q) |
elasticOut(p, a, q) |
elasticInOut(p, a, q) |
elasticOutIn(p, a, q) |
Every function should obtain progress as input and a few parameters(if needed).
CGFloat customAmplitude = ...
CGFloat progress = ...
CGFloat easedProgress = elasticInOut(progress, customAmplitude, ESQDefaultElasticPeriod);
Pleae, take a note, that default values for functions provided available in each header where this funciton described.
easeqs-objc is available through CocoaPods or may be easily build from source.
If you're using Swift, you may wish to install dynamic frameworks, which can be done with the Podfile shown below:
platform :ios, '9.0'
use_frameworks!
pod 'easeqs-objc'