Latest 0.1.1
Homepage https://github.com/nikburnt/easeqs-objc
License MIT
Platforms ios 9.0, requires ARC
Authors

CocoaPods Version [GitHub issues]() Build Status codecov

Quick Look

This library was created for general usage when keyframe animations used and key values can’t be easily interpolated thru animation progress.

easeqs

Availabble Easing Functions

Here is the list of available easing functions:

In Out InOut OutIn
Linear easeqs-objc easeqs-objc easeqs-objc easeqs-objc
Sinusoidal easeqs-objc easeqs-objc easeqs-objc easeqs-objc
Quadratic easeqs-objc easeqs-objc easeqs-objc easeqs-objc
Cubic easeqs-objc easeqs-objc easeqs-objc easeqs-objc
Quartic easeqs-objc easeqs-objc easeqs-objc easeqs-objc
Quintic easeqs-objc easeqs-objc easeqs-objc easeqs-objc
Exponential easeqs-objc easeqs-objc easeqs-objc easeqs-objc
Circular easeqs-objc easeqs-objc easeqs-objc easeqs-objc
Back easeqs-objc easeqs-objc easeqs-objc easeqs-objc
Bounce easeqs-objc easeqs-objc easeqs-objc easeqs-objc
Elastic easeqs-objc easeqs-objc easeqs-objc easeqs-objc

Usage

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:

  1. Without any parameters, default values will be used for type(ESQEasingFunctionTypeOut) and parameters
    CGFloat progress = ...
    ESQEasingFunction *easingFunction = [[ESQElasticEasingFunction alloc] init];
    CGFloat easedProgress = [easingFunction easedProgress:progress];
  2. With specified type(if functiona also have a parameters default values will be used)
    CGFloat progress = ...
    ESQEasingFunction *easingFunction = [ESQElasticEasingFunction easingFunctionWithType:ESQEasingFunctionTypeInOut];
    CGFloat easedProgress = [easingFunction easedProgress:progress];
  3. With specified type and parameters:
    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.

Installing

easeqs-objc is available through CocoaPods or may be easily build from source.

Dynamic Framework

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'

Roadmap

  • Add 4 dimensions structures keyframe animaiton support(CGRect)
  • Add Carthage support
  • Think about better way to describe multiple easing funcitons for the animaiton of complex structures(2 or more dimensional)
  • Create Swift version

Latest podspec

{
    "name": "easeqs-objc",
    "version": "0.1.1",
    "summary": "An easing equations for your purposes and some additionals for keyframe animations",
    "homepage": "https://github.com/nikburnt/easeqs-objc",
    "authors": {
        "Nik Burnt": "[email protected]"
    },
    "source": {
        "git": "https://github.com/nikburnt/easeqs-objc.git",
        "tag": "0.1.1"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source_files": "Sources/**/*.{h,m}",
    "public_header_files": "Sources/**/*.h"
}

Pin It on Pinterest

Share This