Latest 0.0.1
Homepage https://github.com/thegreatloser/UIView-Easing
License MIT
Platforms ios 7.0, requires ARC
Authors

UIView+Easing

Inspired from UIView-EasingFunctions with some difference in implementation, this doesn’t use AHEasing, instead it uses CAMediaTimingFunction. Created mainly because the previously mentioned repo doesn’t support ios8 and results in spazzy animations and also has problems with 64bit architecture.

Easings Supported

Please refer to easings.net for all the different possibilities of easings.

  • easeInSine
  • easeOutSine
  • easeInOutSine
  • easeInQuad
  • easeOutQuad
  • easeInOutQuad
  • easeInCubic
  • easeOutCubic
  • easeInOutCubic
  • easeInQuart
  • easeOutQuart
  • easeInOutQuart
  • easeInQuint
  • easeOutQuint
  • easeInOutQuint
  • easeInExpo
  • easeOutExpo
  • easeInOutExpo
  • easeInCirc
  • easeOutCirc
  • easeInOutCirc
  • easeInBack
  • easeOutBack
  • easeInOutBack

Installation ¯_(ツ)_/¯

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AFNetworking in your projects. See the "Getting Started" guide for more information.

Podfile

platform :ios, '7.0'
pod "UIView-Easing", "~> 0.0.1"

Installation from Source

Simply add the UIView+Easing.h and UIView+Easing.m files inside your project.

Usage (•ิ_•ิ)?

Just import the UIView+Easing.h file where ever needed and write in something like the following.

[self.dialogView setEasingFunction:easeOutBack forKeyPath:@"center"];
[UIView animateWithDuration:.6 animations:^{
self.dialogView.center = CGPointMake(CGRectGetMidX(self.view.bounds), CGRectGetMidY(self.view.bounds));
} completion:^(BOOL finished) {

[self.dialogView removeEasingFunctionForKeyPath:@"center"];
[self.dialogView removeEasingFunctionForKeyPath:@"transform"];

}];

Using your custom easing functions

[self.button setEasingFunction:CreateCAMediaTimingFunction(0.47, 0, 0.745, 0.715) forKeyPath:@"center"];
[UIView animateWithDuration:.6 animations:^{
    self.button.center = CGPointMake(160,80);
} completion:^(BOOL finished) {

[self.button removeEasingFunctionForKeyPath:@"center"];

}];

Demo

Click here to redirect to youtube (Too bad github doesn't provide video embedding)

Contact

Follow me on Twitter (@tapthaker)

Problems ? (✖╭╮✖)

  • Add a new issue on github.
  • Add a question on stackoverflow and mention me in a tweet with the link.

To improve

  • Add elastic and bounce easings

Latest podspec

{
    "name": "UIView-Easing",
    "version": "0.0.1",
    "summary": "Adding Easing to UIView animation blocks",
    "description": "Inspired from UIView-EasingFunctions with some difference in implementation, this doesnt use AHEasing, instead it uses CAMediaTimingFunction. Created mainly because the previously mentioned repo doesnt support ios8 and results in spazzy animations and also has problems with 64bit architecture.",
    "homepage": "https://github.com/thegreatloser/UIView-Easing",
    "platforms": {
        "ios": "7.0"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Tapan Thaker": "[email protected]"
    },
    "source": {
        "git": "https://github.com/thegreatloser/UIView-Easing.git",
        "tag": "0.0.1"
    },
    "source_files": "Source/*.{m,h}",
    "requires_arc": true
}

Pin It on Pinterest

Share This