Giter Site home page Giter Site logo

easeqs-objc's Introduction

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
Sinusoidal
Quadratic
Cubic
Quartic
Quintic
Exponential
Circular
Back
Bounce
Elastic

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];
  1. 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];
  1. 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.