#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.
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
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.
platform :ios, '7.0'
pod "UIView-Easing", "~> 0.0.1"
Simply add the UIView+Easing.h and UIView+Easing.m files inside your project.
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"];
}];
[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"];
}];
Follow me on Twitter (@tapthaker)
- Add a new issue on github.
- Add a question on stackoverflow and mention me in a tweet with the link.
- Add elastic and bounce easings