Latest 1.0.1
Homepage https://github.com/calm/CalmParametricAnimations
License MIT
Platforms ios 8.0, tvos 9.0, requires ARC
Frameworks QuartzCore, CoreGraphics
Authors

A nice iOS extension that gives CAKeyframeAnimation support for all of the complex easing curves found at http://easings.net

Installation

Add pod 'CalmParametricAnimations' to your Podfile or download the source here

Curves

CalmParametricAnimations supports the following curves (type ParametricTimeBlock):

typedef double (^ParametricTimeBlock)(double time)

sineIn
sineOut
sineInOut
squashedSineInOut

linear

appleIn
appleOut
appleInOut

backIn
backOut
backInOut
easeInBackOut
easeOutDramatic

quadraticIn
quadraticOut

cubicIn
cubicOut
cubicInOut

circularIn
circularOut

expoIn
expoOut
expoInOut

elasticIn
elasticOut

variableElasticOut (intensity) -> ParametricTimeBlock
bezierEvaluator (time, point1, point2) -> ParametricTimeBlock
arc (radius, center) -> ParametricTimeBlock

These can the be evaluated directly as functions passing double time from 0 – 1, or by using one of the "value blocks" we’ve defined:

double
point
size
rect
color
transform3D

Each of these value blocks has a corresponding extension method on CAKeyframeAnimation that allows passing of the key-path, the time function. For example:

+ (instancetype)animationWithKeyPath:(NSString *)path
                             timeFxn:(ParametricTimeBlock)timeFxn
                            fromRect:(CGRect)fromValue
                              toRect:(CGRect)toValue;

which will producte an animation that interpolates between the two rects according to the easing curve, with the duration set after initialization.

Latest podspec

{
    "name": "CalmParametricAnimations",
    "version": "1.0.1",
    "summary": "Extends native CAKeyframeAnimations to use all of the complex easing functions found at http://www.easings.net",
    "homepage": "https://github.com/calm/CalmParametricAnimations",
    "license": "MIT",
    "authors": {
        "tsheaff": "[email protected]"
    },
    "source": {
        "git": "https://github.com/calm/CalmParametricAnimations.git",
        "tag": "1.0.1"
    },
    "frameworks": [
        "QuartzCore",
        "CoreGraphics"
    ],
    "platforms": {
        "ios": "8.0",
        "tvos": "9.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes"
}

Pin It on Pinterest

Share This