TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Tapan Thaker.
Inspired from UIView-EasingFunctions with some difference in implementation, this doesn't used 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.
Just import the UIView+Easing.h & UIView+Easing.m files into your project directory and use in the following way
[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"];
}];
Follow me on Twitter (@tapthaker)