├── OKEasingFunctions ├── en.lproj │ ├── InfoPlist.strings │ └── OKViewController.xib ├── Default.png ├── Default@2x.png ├── Default-568h@2x.png ├── OKEasingFunctions-Prefix.pch ├── main.m ├── OKAppDelegate.h ├── OKViewController.h ├── OKEasingFunctions-Info.plist ├── OKAppDelegate.m └── OKViewController.m ├── TransformAnimations ├── en.lproj │ ├── InfoPlist.strings │ └── NILViewController.xib ├── Default.png ├── Default@2x.png ├── Default-568h@2x.png ├── main.m ├── NILAppDelegate.h ├── NILViewController.h ├── TransformAnimations-Prefix.pch ├── NILAppDelegate.m ├── TransformAnimations-Info.plist └── NILViewController.m ├── .gitignore ├── CAAnimation-EasingEquations.podspec ├── LICENSE ├── README.md ├── CAAnimation+EasingEquations.h ├── OKEasingFunctions.xcodeproj └── project.pbxproj ├── TransformAnimations.xcodeproj └── project.pbxproj └── CAAnimation+EasingEquations.m /OKEasingFunctions/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /TransformAnimations/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /OKEasingFunctions/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bryanoltman/CAAnimation-EasingEquations/HEAD/OKEasingFunctions/Default.png -------------------------------------------------------------------------------- /TransformAnimations/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bryanoltman/CAAnimation-EasingEquations/HEAD/TransformAnimations/Default.png -------------------------------------------------------------------------------- /OKEasingFunctions/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bryanoltman/CAAnimation-EasingEquations/HEAD/OKEasingFunctions/Default@2x.png -------------------------------------------------------------------------------- /TransformAnimations/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bryanoltman/CAAnimation-EasingEquations/HEAD/TransformAnimations/Default@2x.png -------------------------------------------------------------------------------- /OKEasingFunctions/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bryanoltman/CAAnimation-EasingEquations/HEAD/OKEasingFunctions/Default-568h@2x.png -------------------------------------------------------------------------------- /TransformAnimations/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bryanoltman/CAAnimation-EasingEquations/HEAD/TransformAnimations/Default-568h@2x.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ 19 | -------------------------------------------------------------------------------- /OKEasingFunctions/OKEasingFunctions-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'OKEasingFunctions' target in the 'OKEasingFunctions' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /OKEasingFunctions/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OKEasingFunctions 4 | // 5 | // Created by Bryan Oltman on 12/18/12. 6 | // Copyright (c) 2012 Bryan Oltman. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "OKAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([OKAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /TransformAnimations/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TransformAnimations 4 | // 5 | // Created by Bryan Oltman on 5/24/13. 6 | // Copyright (c) 2013 Bryan Oltman. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "NILAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([NILAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /OKEasingFunctions/OKAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // OKAppDelegate.h 3 | // OKEasingFunctions 4 | // 5 | // Created by Bryan Oltman on 12/18/12. 6 | // Copyright (c) 2012 Bryan Oltman. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class OKViewController; 12 | 13 | @interface OKAppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) OKViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /TransformAnimations/NILAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // NILAppDelegate.h 3 | // TransformAnimations 4 | // 5 | // Created by Bryan Oltman on 5/24/13. 6 | // Copyright (c) 2013 Bryan Oltman. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class NILViewController; 12 | 13 | @interface NILAppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) NILViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /TransformAnimations/NILViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NILViewController.h 3 | // TransformAnimations 4 | // 5 | // Created by Bryan Oltman on 5/24/13. 6 | // Copyright (c) 2013 Bryan Oltman. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NILViewController : UIViewController 12 | 13 | @property (weak, nonatomic) IBOutlet UIView *leftTableView; 14 | @property (weak, nonatomic) IBOutlet UIView *rightTableView; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /TransformAnimations/TransformAnimations-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'TransformAnimations' target in the 'TransformAnimations' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #import 15 | 16 | #import "CAAnimation+EasingEquations.h" 17 | #endif 18 | -------------------------------------------------------------------------------- /OKEasingFunctions/OKViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OKViewController.h 3 | // OKEasingFunctions 4 | // 5 | // Created by Bryan Oltman on 12/18/12. 6 | // Copyright (c) 2012 Bryan Oltman. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OKViewController : UIViewController 12 | 13 | @property (strong, nonatomic) NSArray *easingFunctionNames; 14 | 15 | @property (weak, nonatomic) IBOutlet UIView *animatedView; 16 | @property (weak, nonatomic) IBOutlet UIPickerView *pickerView; 17 | 18 | - (IBAction)playButtonClicked:(id)sender; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /TransformAnimations/NILAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // NILAppDelegate.m 3 | // TransformAnimations 4 | // 5 | // Created by Bryan Oltman on 5/24/13. 6 | // Copyright (c) 2013 Bryan Oltman. All rights reserved. 7 | // 8 | 9 | #import "NILAppDelegate.h" 10 | 11 | #import "NILViewController.h" 12 | 13 | @implementation NILAppDelegate 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 18 | self.viewController = [[NILViewController alloc] initWithNibName:@"NILViewController" bundle:nil]; 19 | self.window.rootViewController = self.viewController; 20 | [self.window makeKeyAndVisible]; 21 | return YES; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /CAAnimation-EasingEquations.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "CAAnimation-EasingEquations" 3 | s.version = "1.0.4" 4 | s.summary = "A category on CAAnimation that provides a number of easing equations to add some zazz to your app (with examples!)" 5 | s.description = <<-DESC 6 | Adding easing to animations makes them more realistic. UIKit provides a very limited set of easing functions, so I added a few more. 7 | Easings.net provides some good examples and further explanation. 8 | DESC 9 | s.homepage = "https://github.com/bryanoltman/CAAnimation-EasingEquations" 10 | s.license = 'MIT' 11 | s.author = { "Bryan" => "bryanoltman@gmail.com" } 12 | s.social_media_url = "http://twitter.com/moltman" 13 | s.platform = :ios 14 | s.source = { :git => "https://github.com/bryanoltman/CAAnimation-EasingEquations.git", :tag => '1.0.4' } 15 | s.source_files = '*.{h,m}' 16 | s.requires_arc = true 17 | 18 | end 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software and associated documentation files (the "Software"), to deal 3 | in the Software without restriction, including without limitation the rights 4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 5 | copies of the Software, and to permit persons to whom the Software is 6 | furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. -------------------------------------------------------------------------------- /OKEasingFunctions/OKEasingFunctions-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | OK.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /TransformAnimations/TransformAnimations-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | NIL.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /OKEasingFunctions/OKAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // OKAppDelegate.m 3 | // OKEasingFunctions 4 | // 5 | // Created by Bryan Oltman on 12/18/12. 6 | // Copyright (c) 2012 Bryan Oltman. All rights reserved. 7 | // 8 | 9 | #import "OKAppDelegate.h" 10 | 11 | #import "OKViewController.h" 12 | 13 | @implementation OKAppDelegate 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 18 | // Override point for customization after application launch. 19 | self.viewController = [[OKViewController alloc] initWithNibName:@"OKViewController" bundle:nil]; 20 | self.window.rootViewController = self.viewController; 21 | [self.window makeKeyAndVisible]; 22 | return YES; 23 | } 24 | 25 | - (void)applicationWillResignActive:(UIApplication *)application 26 | { 27 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 28 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 29 | } 30 | 31 | - (void)applicationDidEnterBackground:(UIApplication *)application 32 | { 33 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 34 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 35 | } 36 | 37 | - (void)applicationWillEnterForeground:(UIApplication *)application 38 | { 39 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 40 | } 41 | 42 | - (void)applicationDidBecomeActive:(UIApplication *)application 43 | { 44 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 45 | } 46 | 47 | - (void)applicationWillTerminate:(UIApplication *)application 48 | { 49 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | CAAnimation-EasingEquations 2 | =========================== 3 | 4 | A category on `CAAnimation` that provides a number of easing equations to add some zazz to your app (with examples!) 5 | 6 | ## Why? 7 | Because adding easing to animations makes them more realistic. UIKit provides a very limited set of easing functions, so I added a few more. 8 | 9 | [Easings.net][0] provides some good examples and further explanation. 10 | 11 | ## To use 12 | Add `pod 'CAAnimation-EasingEquations'` to your podfile 13 | 14 | #### Or 15 | - Link your build target with `QuartzCore` 16 | - Select your project in Xcode's project navigator 17 | - Select your project's target 18 | - Navigate to "Build Phases" 19 | - In the "Link Binary with Libraries" section, click the '+' button 20 | - Select `QuartzCore` and click "Add" 21 | - Add `CAAnimation+EasingEquations.h/m` to your project 22 | - Enjoy! 23 | 24 | ### Animating layer properties with key paths 25 | Because this uses CoreAnimation, animations are applied to `CALayer` objects. For example, if we wanted a `UIView` to become completely transparent over the course of a second, the code to do that would look like this: 26 | 27 | ``` 28 | [CAAnimation addAnimationToLayer:animatedView.layer 29 | withKeyPath:@"opacity" 30 | duration:1 31 | to:0 32 | easingFunction:CAAnimationEasingFuctionEaseInBounce]; 33 | ``` 34 | 35 | In this example, the bounce ease-in function would be used. 36 | 37 | ### Animating layer transforms 38 | Similarly to above, if we wanted to apply a transform to `animatedView`, we could do it like so: 39 | 40 | ``` 41 | CATransform3D tr; 42 | tr = CATransform3DMakeScale(2.5, 2.5, 1.0); 43 | tr = CATransform3DTranslate(tr, 95, 0, 0); 44 | [CAAnimation addAnimationToLayer:animatedView.layer 45 | duration:1 46 | transform:tr 47 | easingFunction:CAAnimationEasingFuctionEaseOutBack]; 48 | ``` 49 | 50 | This would scale `animatedView` to 2.5x its current size and translate it 95px to the right over the course of 1 second. 51 | 52 | ## Examples 53 | 54 | Two sample projets have been included to illustrate the use of this category. 55 | 56 | ### OKEasingFunctions 57 | 58 | This illustrates the different easing functions. This was written before the addition of CATransform3D animation functions, so all animations are performed with key paths. 59 | 60 | ### TransformAnimations 61 | 62 | This illustrates the CATransform3D additions. There are two tables, each with a swipe gesture recognizer. Swipe, and they animate. It's magic! 63 | 64 | ## License 65 | 66 | `CAAnimation+EasingEquations` is licensed under the MIT License. Please give me some kind of attribution if you use it in your project, such as a "thanks" note somewhere. I'd also love to know if you use my code, please drop me a line if you do! See the LICENSE file for full license text. 67 | 68 | [0]: http://easings.net/ 69 | -------------------------------------------------------------------------------- /CAAnimation+EasingEquations.h: -------------------------------------------------------------------------------- 1 | // 2 | // CAAnimation+EasingEquations.h 3 | // OKEasingFunctions 4 | // 5 | // Created by Bryan Oltman on 12/18/12. 6 | // Copyright (c) 2012 Bryan Oltman. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSInteger, CAAnimationEasingFunction) { 12 | CAAnimationEasingFunctionLinear, 13 | 14 | CAAnimationEasingFunctionEaseInQuad, 15 | CAAnimationEasingFunctionEaseOutQuad, 16 | CAAnimationEasingFunctionEaseInOutQuad, 17 | 18 | CAAnimationEasingFunctionEaseInCubic, 19 | CAAnimationEasingFunctionEaseOutCubic, 20 | CAAnimationEasingFunctionEaseInOutCubic, 21 | 22 | CAAnimationEasingFunctionEaseInQuartic, 23 | CAAnimationEasingFunctionEaseOutQuartic, 24 | CAAnimationEasingFunctionEaseInOutQuartic, 25 | 26 | CAAnimationEasingFunctionEaseInQuintic, 27 | CAAnimationEasingFunctionEaseOutQuintic, 28 | CAAnimationEasingFunctionEaseInOutQuintic, 29 | 30 | CAAnimationEasingFunctionEaseInSine, 31 | CAAnimationEasingFunctionEaseOutSine, 32 | CAAnimationEasingFunctionEaseInOutSine, 33 | 34 | CAAnimationEasingFunctionEaseInExponential, 35 | CAAnimationEasingFunctionEaseOutExponential, 36 | CAAnimationEasingFunctionEaseInOutExponential, 37 | 38 | CAAnimationEasingFunctionEaseInCircular, 39 | CAAnimationEasingFunctionEaseOutCircular, 40 | CAAnimationEasingFunctionEaseInOutCircular, 41 | 42 | CAAnimationEasingFunctionEaseInElastic, 43 | CAAnimationEasingFunctionEaseOutElastic, 44 | CAAnimationEasingFunctionEaseInOutElastic, 45 | 46 | CAAnimationEasingFunctionEaseInBack, 47 | CAAnimationEasingFunctionEaseOutBack, 48 | CAAnimationEasingFunctionEaseInOutBack, 49 | 50 | CAAnimationEasingFunctionEaseInBounce, 51 | CAAnimationEasingFunctionEaseOutBounce, 52 | CAAnimationEasingFunctionEaseInOutBounce 53 | }; 54 | 55 | @interface CAAnimation (EasingEquations) 56 | + (CAKeyframeAnimation*)transformAnimationWithDuration:(CGFloat)duration 57 | from:(CATransform3D)startValue 58 | to:(CATransform3D)endValue 59 | easingFunction:(CAAnimationEasingFunction)easingFunction; 60 | 61 | + (void)addAnimationToLayer:(CALayer *)layer 62 | duration:(CGFloat)duration 63 | transform:(CATransform3D)transform 64 | easingFunction:(CAAnimationEasingFunction)easingFunction; 65 | 66 | + (CAKeyframeAnimation*)animationWithKeyPath:(NSString *)keyPath 67 | duration:(CGFloat)duration 68 | from:(CGFloat)startValue 69 | to:(CGFloat)endValue 70 | easingFunction:(CAAnimationEasingFunction)easingFunction; 71 | 72 | + (void)addAnimationToLayer:(CALayer *)layer 73 | withKeyPath:(NSString *)keyPath 74 | duration:(CGFloat)duration 75 | to:(CGFloat)endValue 76 | easingFunction:(CAAnimationEasingFunction)easingFunction; 77 | 78 | + (void)addAnimationToLayer:(CALayer *)layer 79 | withKeyPath:(NSString *)keyPath 80 | duration:(CGFloat)duration 81 | from:(CGFloat)startValue 82 | to:(CGFloat)endValue 83 | easingFunction:(CAAnimationEasingFunction)easingFunction; 84 | @end 85 | -------------------------------------------------------------------------------- /OKEasingFunctions/OKViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // OKViewController.m 3 | // OKEasingFunctions 4 | // 5 | // Created by Bryan Oltman on 12/18/12. 6 | // Copyright (c) 2012 Bryan Oltman. All rights reserved. 7 | // 8 | 9 | #import "OKViewController.h" 10 | #import "CAAnimation+EasingEquations.h" 11 | 12 | @implementation OKViewController 13 | 14 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 15 | { 16 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 17 | if (self) { 18 | self.easingFunctionNames = @[ 19 | @"Linear", 20 | @"EaseInQuad", 21 | @"EaseOutQuad", 22 | @"EaseInOutQuad", 23 | @"EaseInCubic", 24 | @"EaseOutCubic", 25 | @"EaseInOutCubic", 26 | @"EaseInQuartic", 27 | @"EaseOutQuartic", 28 | @"EaseInOutQuartic", 29 | @"EaseInQuintic", 30 | @"EaseOutQuintic", 31 | @"EaseInOutQuintic", 32 | @"EaseInSine", 33 | @"EaseOutSine", 34 | @"EaseInOutSine", 35 | @"EaseInExponential", 36 | @"EaseOutExponential", 37 | @"EaseInOutExponential", 38 | @"EaseInCircular", 39 | @"EaseOutCircular", 40 | @"EaseInOutCircular", 41 | @"EaseInElastic", 42 | @"EaseOutElastic", 43 | @"EaseInOutElastic", 44 | @"EaseInBack", 45 | @"EaseOutBack", 46 | @"EaseInOutBack", 47 | @"EaseInBounce", 48 | @"EaseOutBounce", 49 | @"EaseInOutBounce" 50 | ]; 51 | } 52 | 53 | return self; 54 | } 55 | 56 | #pragma mark - IBActions 57 | - (void)playButtonClicked:(id)sender 58 | { 59 | // Resettin' thangs 60 | CGRect frame = self.animatedView.frame; 61 | frame.origin.x = 20; 62 | self.animatedView.frame = frame; 63 | 64 | CAAnimationEasingFunction selectedEasingFunction = (CAAnimationEasingFunction)[self.pickerView selectedRowInComponent:0]; 65 | 66 | [CAAnimation addAnimationToLayer:self.animatedView.layer 67 | withKeyPath:@"position.x" 68 | duration:1 69 | to:250 70 | easingFunction:selectedEasingFunction]; 71 | } 72 | 73 | #pragma mark - UIPickerViewDataSource/Delegate 74 | -(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component 75 | { 76 | return [self.easingFunctionNames objectAtIndex:row]; 77 | } 78 | 79 | - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component 80 | { 81 | return self.easingFunctionNames.count; 82 | } 83 | 84 | - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView 85 | { 86 | return 1; 87 | } 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /TransformAnimations/NILViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NILViewController.m 3 | // TransformAnimations 4 | // 5 | // Created by Bryan Oltman on 5/24/13. 6 | // Copyright (c) 2013 Bryan Oltman. All rights reserved. 7 | // 8 | 9 | #import "NILViewController.h" 10 | 11 | @implementation NILViewController 12 | 13 | - (void)viewDidLoad 14 | { 15 | [super viewDidLoad]; 16 | 17 | UISwipeGestureRecognizer *recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self 18 | action:@selector(viewSwiped:)]; 19 | recognizer.direction = UISwipeGestureRecognizerDirectionLeft; 20 | [self.leftTableView addGestureRecognizer:recognizer]; 21 | 22 | recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self 23 | action:@selector(viewSwiped:)]; 24 | recognizer.direction = UISwipeGestureRecognizerDirectionRight; 25 | [self.rightTableView addGestureRecognizer:recognizer]; 26 | 27 | self.rightTableView.frame = CGRectOffset(self.rightTableView.frame, self.view.frame.size.width, 0); 28 | } 29 | 30 | - (void)viewSwiped:(UISwipeGestureRecognizer *)sender 31 | { 32 | CAAnimationEasingFunction f = CAAnimationEasingFunctionEaseOutElastic; 33 | CGFloat d = 1; 34 | if (sender.direction == UISwipeGestureRecognizerDirectionLeft && 35 | sender.view == self.leftTableView) { 36 | CATransform3D tr; 37 | 38 | // An example of how to "stack" transforms 39 | tr = CATransform3DMakeScale(2.5, 2.5, 1.0); 40 | tr = CATransform3DTranslate(tr, 95, 0, 0); 41 | [CAAnimation addAnimationToLayer:self.leftTableView.layer 42 | duration:d 43 | transform:tr 44 | // transform:CATransform3DMakeRotation(250, 0, 0, 1) 45 | // transform:CATransform3DMakeTranslation(-self.view.bounds.size.width, 0, 0) 46 | easingFunction:f]; 47 | [CAAnimation addAnimationToLayer:self.rightTableView.layer 48 | duration:d 49 | transform:CATransform3DMakeTranslation(-self.view.bounds.size.width, 0, 0) 50 | easingFunction:f]; 51 | } 52 | else if (sender.direction == UISwipeGestureRecognizerDirectionRight && 53 | sender.view == self.rightTableView) { 54 | [CAAnimation addAnimationToLayer:self.leftTableView.layer 55 | duration:d 56 | transform:CATransform3DIdentity 57 | easingFunction:f]; 58 | [CAAnimation addAnimationToLayer:self.rightTableView.layer 59 | duration:d 60 | transform:CATransform3DIdentity 61 | easingFunction:f]; 62 | } 63 | } 64 | 65 | #pragma mark - Table View 66 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 67 | { 68 | return 150; 69 | } 70 | 71 | - (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)aIndexPath 72 | { 73 | static NSString *reuseId = @"reuseId"; 74 | UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:reuseId]; 75 | 76 | if (!cell) { 77 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault 78 | reuseIdentifier:reuseId]; 79 | } 80 | 81 | cell.textLabel.text = [NSString stringWithFormat:@"This is row %d", aIndexPath.row]; 82 | 83 | return cell; 84 | } 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /TransformAnimations/en.lproj/NILViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1552 5 | 12D78 6 | 3084 7 | 1187.37 8 | 626.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 2083 12 | 13 | 14 | IBProxyObject 15 | IBUITableView 16 | IBUIView 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 274 37 | 38 | 39 | 40 | 274 41 | {320, 548} 42 | 43 | 44 | 45 | _NS:9 46 | 47 | 1 48 | MSAwLjgxMjAzOTc4MTIgMC4zOTI4NDM4ODkxIDAuMjIAA 49 | 50 | YES 51 | IBCocoaTouchFramework 52 | YES 53 | NO 54 | 1 55 | 0 56 | YES 57 | 44 58 | 22 59 | 22 60 | 61 | 62 | 63 | 274 64 | {320, 548} 65 | 66 | 67 | 68 | _NS:9 69 | 70 | 1 71 | MC41NTQxNDAwNDg5IDAuNjE3Njk2Njc4NiAxIDAuMzQAA 72 | 73 | YES 74 | IBCocoaTouchFramework 75 | YES 76 | YES 77 | NO 78 | 1 79 | 0 80 | YES 81 | 44 82 | 22 83 | 22 84 | 85 | 86 | {{0, 20}, {320, 548}} 87 | 88 | 89 | 90 | 91 | 3 92 | MC43NQA 93 | 94 | 2 95 | 96 | 97 | NO 98 | 99 | 100 | IBUIScreenMetrics 101 | 102 | YES 103 | 104 | 105 | 106 | 107 | 108 | {320, 568} 109 | {568, 320} 110 | 111 | 112 | IBCocoaTouchFramework 113 | Retina 4 Full Screen 114 | 2 115 | 116 | IBCocoaTouchFramework 117 | 118 | 119 | 120 | 121 | 122 | 123 | view 124 | 125 | 126 | 127 | 7 128 | 129 | 130 | 131 | leftTableView 132 | 133 | 134 | 135 | 34 136 | 137 | 138 | 139 | rightTableView 140 | 141 | 142 | 143 | 35 144 | 145 | 146 | 147 | dataSource 148 | 149 | 150 | 151 | 36 152 | 153 | 154 | 155 | delegate 156 | 157 | 158 | 159 | 37 160 | 161 | 162 | 163 | dataSource 164 | 165 | 166 | 167 | 38 168 | 169 | 170 | 171 | delegate 172 | 173 | 174 | 175 | 39 176 | 177 | 178 | 179 | 180 | 181 | 0 182 | 183 | 184 | 185 | 186 | 187 | -1 188 | 189 | 190 | File's Owner 191 | 192 | 193 | -2 194 | 195 | 196 | 197 | 198 | 6 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 32 208 | 209 | 210 | 211 | 212 | 33 213 | 214 | 215 | 216 | 217 | 218 | 219 | NILViewController 220 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 221 | UIResponder 222 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 223 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 224 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 225 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 226 | 227 | 228 | 229 | 230 | 231 | 39 232 | 233 | 234 | 235 | 236 | NILViewController 237 | UIViewController 238 | 239 | UIView 240 | UIView 241 | 242 | 243 | 244 | leftTableView 245 | UIView 246 | 247 | 248 | rightTableView 249 | UIView 250 | 251 | 252 | 253 | IBProjectSource 254 | ./Classes/NILViewController.h 255 | 256 | 257 | 258 | 259 | 0 260 | IBCocoaTouchFramework 261 | YES 262 | 3 263 | 2083 264 | 265 | 266 | -------------------------------------------------------------------------------- /OKEasingFunctions/en.lproj/OKViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1536 5 | 12C60 6 | 2844 7 | 1187.34 8 | 625.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 1930 12 | 13 | 14 | IBProxyObject 15 | IBUIButton 16 | IBUIPickerView 17 | IBUIView 18 | 19 | 20 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 21 | 22 | 23 | PluginDependencyRecalculationVersion 24 | 25 | 26 | 27 | 28 | IBFilesOwner 29 | IBCocoaTouchFramework 30 | 31 | 32 | IBFirstResponder 33 | IBCocoaTouchFramework 34 | 35 | 36 | 37 | 274 38 | 39 | 40 | 41 | 268 42 | {{20, 120}, {75, 75}} 43 | 44 | 45 | 46 | _NS:9 47 | 48 | 1 49 | MSAwLjQ0MjE0MTE4MjEgMC4yMjY4NjM5NDI0AA 50 | 51 | IBCocoaTouchFramework 52 | 53 | 54 | 55 | 265 56 | {{245, 281}, {55, 44}} 57 | 58 | 59 | 60 | _NS:9 61 | NO 62 | IBCocoaTouchFramework 63 | 0 64 | 0 65 | 1 66 | Play 67 | 68 | 3 69 | MQA 70 | 71 | 72 | 1 73 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 74 | 75 | 76 | 3 77 | MC41AA 78 | 79 | 80 | 2 81 | 15 82 | 83 | 84 | Helvetica-Bold 85 | 15 86 | 16 87 | 88 | 89 | 90 | 91 | 266 92 | {{0, 332}, {320, 216}} 93 | 94 | 95 | 96 | _NS:9 97 | IBCocoaTouchFramework 98 | YES 99 | 100 | 101 | {{0, 20}, {320, 548}} 102 | 103 | 104 | 105 | 106 | 1 107 | MC43NDEwMTE2MzkgMC43NDEwMTE2MzkgMC43NDEwMTE2MzkAA 108 | 109 | NO 110 | 111 | 112 | IBUIScreenMetrics 113 | 114 | YES 115 | 116 | 117 | 118 | 119 | 120 | {320, 568} 121 | {568, 320} 122 | 123 | 124 | IBCocoaTouchFramework 125 | Retina 4 Full Screen 126 | 2 127 | 128 | IBCocoaTouchFramework 129 | 130 | 131 | 132 | 133 | 134 | 135 | view 136 | 137 | 138 | 139 | 7 140 | 141 | 142 | 143 | animatedView 144 | 145 | 146 | 147 | 17 148 | 149 | 150 | 151 | pickerView 152 | 153 | 154 | 155 | 19 156 | 157 | 158 | 159 | dataSource 160 | 161 | 162 | 163 | 13 164 | 165 | 166 | 167 | delegate 168 | 169 | 170 | 171 | 14 172 | 173 | 174 | 175 | playButtonClicked: 176 | 177 | 178 | 7 179 | 180 | 18 181 | 182 | 183 | 184 | 185 | 186 | 0 187 | 188 | 189 | 190 | 191 | 192 | -1 193 | 194 | 195 | File's Owner 196 | 197 | 198 | -2 199 | 200 | 201 | 202 | 203 | 6 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 8 214 | 215 | 216 | 217 | 218 | 219 | 15 220 | 221 | 222 | 223 | 224 | 16 225 | 226 | 227 | 228 | 229 | 230 | 231 | OKViewController 232 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 233 | UIResponder 234 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 235 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 236 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 237 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 238 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 239 | 240 | 241 | 242 | 243 | 244 | 19 245 | 246 | 247 | 248 | 249 | OKViewController 250 | UIViewController 251 | 252 | playButtonClicked: 253 | id 254 | 255 | 256 | playButtonClicked: 257 | 258 | playButtonClicked: 259 | id 260 | 261 | 262 | 263 | UIView 264 | UIPickerView 265 | 266 | 267 | 268 | animatedView 269 | UIView 270 | 271 | 272 | pickerView 273 | UIPickerView 274 | 275 | 276 | 277 | IBProjectSource 278 | ./Classes/OKViewController.h 279 | 280 | 281 | 282 | 283 | 0 284 | IBCocoaTouchFramework 285 | YES 286 | 3 287 | 1930 288 | 289 | 290 | -------------------------------------------------------------------------------- /OKEasingFunctions.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | ED5D371A168403A30073DA10 /* CAAnimation+EasingEquations.m in Sources */ = {isa = PBXBuildFile; fileRef = ED5D3719168403A30073DA10 /* CAAnimation+EasingEquations.m */; }; 11 | EDAF31841681799D000A62D9 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDAF31831681799D000A62D9 /* UIKit.framework */; }; 12 | EDAF31861681799D000A62D9 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDAF31851681799D000A62D9 /* Foundation.framework */; }; 13 | EDAF31881681799D000A62D9 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDAF31871681799D000A62D9 /* CoreGraphics.framework */; }; 14 | EDAF318E1681799D000A62D9 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EDAF318C1681799D000A62D9 /* InfoPlist.strings */; }; 15 | EDAF31901681799D000A62D9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = EDAF318F1681799D000A62D9 /* main.m */; }; 16 | EDAF31941681799D000A62D9 /* OKAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = EDAF31931681799D000A62D9 /* OKAppDelegate.m */; }; 17 | EDAF31961681799D000A62D9 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = EDAF31951681799D000A62D9 /* Default.png */; }; 18 | EDAF31981681799D000A62D9 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = EDAF31971681799D000A62D9 /* Default@2x.png */; }; 19 | EDAF319A1681799D000A62D9 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = EDAF31991681799D000A62D9 /* Default-568h@2x.png */; }; 20 | EDAF319D1681799D000A62D9 /* OKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EDAF319C1681799D000A62D9 /* OKViewController.m */; }; 21 | EDAF31A01681799D000A62D9 /* OKViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = EDAF319E1681799D000A62D9 /* OKViewController.xib */; }; 22 | EDAF31AA168179C6000A62D9 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDAF31A9168179C6000A62D9 /* QuartzCore.framework */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | ED5D3718168403A30073DA10 /* CAAnimation+EasingEquations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CAAnimation+EasingEquations.h"; sourceTree = SOURCE_ROOT; }; 27 | ED5D3719168403A30073DA10 /* CAAnimation+EasingEquations.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CAAnimation+EasingEquations.m"; sourceTree = SOURCE_ROOT; }; 28 | EDAF317F1681799D000A62D9 /* OKEasingFunctions.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OKEasingFunctions.app; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | EDAF31831681799D000A62D9 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 30 | EDAF31851681799D000A62D9 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 31 | EDAF31871681799D000A62D9 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 32 | EDAF318B1681799D000A62D9 /* OKEasingFunctions-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "OKEasingFunctions-Info.plist"; sourceTree = ""; }; 33 | EDAF318D1681799D000A62D9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 34 | EDAF318F1681799D000A62D9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 35 | EDAF31911681799D000A62D9 /* OKEasingFunctions-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "OKEasingFunctions-Prefix.pch"; sourceTree = ""; }; 36 | EDAF31921681799D000A62D9 /* OKAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OKAppDelegate.h; sourceTree = ""; }; 37 | EDAF31931681799D000A62D9 /* OKAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OKAppDelegate.m; sourceTree = ""; }; 38 | EDAF31951681799D000A62D9 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 39 | EDAF31971681799D000A62D9 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 40 | EDAF31991681799D000A62D9 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 41 | EDAF319B1681799D000A62D9 /* OKViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OKViewController.h; sourceTree = ""; }; 42 | EDAF319C1681799D000A62D9 /* OKViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OKViewController.m; sourceTree = ""; }; 43 | EDAF319F1681799D000A62D9 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/OKViewController.xib; sourceTree = ""; }; 44 | EDAF31A9168179C6000A62D9 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | EDAF317C1681799C000A62D9 /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | EDAF31AA168179C6000A62D9 /* QuartzCore.framework in Frameworks */, 53 | EDAF31841681799D000A62D9 /* UIKit.framework in Frameworks */, 54 | EDAF31861681799D000A62D9 /* Foundation.framework in Frameworks */, 55 | EDAF31881681799D000A62D9 /* CoreGraphics.framework in Frameworks */, 56 | ); 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | /* End PBXFrameworksBuildPhase section */ 60 | 61 | /* Begin PBXGroup section */ 62 | EDAF31741681799C000A62D9 = { 63 | isa = PBXGroup; 64 | children = ( 65 | EDAF31891681799D000A62D9 /* OKEasingFunctions */, 66 | EDAF318A1681799D000A62D9 /* Supporting Files */, 67 | EDAF31821681799D000A62D9 /* Frameworks */, 68 | EDAF31801681799D000A62D9 /* Products */, 69 | ); 70 | sourceTree = ""; 71 | }; 72 | EDAF31801681799D000A62D9 /* Products */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | EDAF317F1681799D000A62D9 /* OKEasingFunctions.app */, 76 | ); 77 | name = Products; 78 | sourceTree = ""; 79 | }; 80 | EDAF31821681799D000A62D9 /* Frameworks */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | EDAF31871681799D000A62D9 /* CoreGraphics.framework */, 84 | EDAF31851681799D000A62D9 /* Foundation.framework */, 85 | EDAF31A9168179C6000A62D9 /* QuartzCore.framework */, 86 | EDAF31831681799D000A62D9 /* UIKit.framework */, 87 | ); 88 | name = Frameworks; 89 | sourceTree = ""; 90 | }; 91 | EDAF31891681799D000A62D9 /* OKEasingFunctions */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | ED5D3718168403A30073DA10 /* CAAnimation+EasingEquations.h */, 95 | ED5D3719168403A30073DA10 /* CAAnimation+EasingEquations.m */, 96 | EDAF31921681799D000A62D9 /* OKAppDelegate.h */, 97 | EDAF31931681799D000A62D9 /* OKAppDelegate.m */, 98 | EDAF319B1681799D000A62D9 /* OKViewController.h */, 99 | EDAF319C1681799D000A62D9 /* OKViewController.m */, 100 | EDAF319E1681799D000A62D9 /* OKViewController.xib */, 101 | ); 102 | path = OKEasingFunctions; 103 | sourceTree = ""; 104 | }; 105 | EDAF318A1681799D000A62D9 /* Supporting Files */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | EDAF318B1681799D000A62D9 /* OKEasingFunctions-Info.plist */, 109 | EDAF318C1681799D000A62D9 /* InfoPlist.strings */, 110 | EDAF318F1681799D000A62D9 /* main.m */, 111 | EDAF31911681799D000A62D9 /* OKEasingFunctions-Prefix.pch */, 112 | EDAF31951681799D000A62D9 /* Default.png */, 113 | EDAF31971681799D000A62D9 /* Default@2x.png */, 114 | EDAF31991681799D000A62D9 /* Default-568h@2x.png */, 115 | ); 116 | name = "Supporting Files"; 117 | path = OKEasingFunctions; 118 | sourceTree = ""; 119 | }; 120 | /* End PBXGroup section */ 121 | 122 | /* Begin PBXNativeTarget section */ 123 | EDAF317E1681799C000A62D9 /* OKEasingFunctions */ = { 124 | isa = PBXNativeTarget; 125 | buildConfigurationList = EDAF31A31681799D000A62D9 /* Build configuration list for PBXNativeTarget "OKEasingFunctions" */; 126 | buildPhases = ( 127 | EDAF317B1681799C000A62D9 /* Sources */, 128 | EDAF317C1681799C000A62D9 /* Frameworks */, 129 | EDAF317D1681799C000A62D9 /* Resources */, 130 | ); 131 | buildRules = ( 132 | ); 133 | dependencies = ( 134 | ); 135 | name = OKEasingFunctions; 136 | productName = OKEasingFunctions; 137 | productReference = EDAF317F1681799D000A62D9 /* OKEasingFunctions.app */; 138 | productType = "com.apple.product-type.application"; 139 | }; 140 | /* End PBXNativeTarget section */ 141 | 142 | /* Begin PBXProject section */ 143 | EDAF31761681799C000A62D9 /* Project object */ = { 144 | isa = PBXProject; 145 | attributes = { 146 | CLASSPREFIX = OK; 147 | LastUpgradeCheck = 0450; 148 | ORGANIZATIONNAME = "Bryan Oltman"; 149 | }; 150 | buildConfigurationList = EDAF31791681799C000A62D9 /* Build configuration list for PBXProject "OKEasingFunctions" */; 151 | compatibilityVersion = "Xcode 3.2"; 152 | developmentRegion = English; 153 | hasScannedForEncodings = 0; 154 | knownRegions = ( 155 | en, 156 | ); 157 | mainGroup = EDAF31741681799C000A62D9; 158 | productRefGroup = EDAF31801681799D000A62D9 /* Products */; 159 | projectDirPath = ""; 160 | projectRoot = ""; 161 | targets = ( 162 | EDAF317E1681799C000A62D9 /* OKEasingFunctions */, 163 | ); 164 | }; 165 | /* End PBXProject section */ 166 | 167 | /* Begin PBXResourcesBuildPhase section */ 168 | EDAF317D1681799C000A62D9 /* Resources */ = { 169 | isa = PBXResourcesBuildPhase; 170 | buildActionMask = 2147483647; 171 | files = ( 172 | EDAF318E1681799D000A62D9 /* InfoPlist.strings in Resources */, 173 | EDAF31961681799D000A62D9 /* Default.png in Resources */, 174 | EDAF31981681799D000A62D9 /* Default@2x.png in Resources */, 175 | EDAF319A1681799D000A62D9 /* Default-568h@2x.png in Resources */, 176 | EDAF31A01681799D000A62D9 /* OKViewController.xib in Resources */, 177 | ); 178 | runOnlyForDeploymentPostprocessing = 0; 179 | }; 180 | /* End PBXResourcesBuildPhase section */ 181 | 182 | /* Begin PBXSourcesBuildPhase section */ 183 | EDAF317B1681799C000A62D9 /* Sources */ = { 184 | isa = PBXSourcesBuildPhase; 185 | buildActionMask = 2147483647; 186 | files = ( 187 | EDAF31901681799D000A62D9 /* main.m in Sources */, 188 | EDAF31941681799D000A62D9 /* OKAppDelegate.m in Sources */, 189 | EDAF319D1681799D000A62D9 /* OKViewController.m in Sources */, 190 | ED5D371A168403A30073DA10 /* CAAnimation+EasingEquations.m in Sources */, 191 | ); 192 | runOnlyForDeploymentPostprocessing = 0; 193 | }; 194 | /* End PBXSourcesBuildPhase section */ 195 | 196 | /* Begin PBXVariantGroup section */ 197 | EDAF318C1681799D000A62D9 /* InfoPlist.strings */ = { 198 | isa = PBXVariantGroup; 199 | children = ( 200 | EDAF318D1681799D000A62D9 /* en */, 201 | ); 202 | name = InfoPlist.strings; 203 | sourceTree = ""; 204 | }; 205 | EDAF319E1681799D000A62D9 /* OKViewController.xib */ = { 206 | isa = PBXVariantGroup; 207 | children = ( 208 | EDAF319F1681799D000A62D9 /* en */, 209 | ); 210 | name = OKViewController.xib; 211 | sourceTree = ""; 212 | }; 213 | /* End PBXVariantGroup section */ 214 | 215 | /* Begin XCBuildConfiguration section */ 216 | EDAF31A11681799D000A62D9 /* Debug */ = { 217 | isa = XCBuildConfiguration; 218 | buildSettings = { 219 | ALWAYS_SEARCH_USER_PATHS = NO; 220 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 221 | CLANG_CXX_LIBRARY = "libc++"; 222 | CLANG_ENABLE_OBJC_ARC = YES; 223 | CLANG_WARN_EMPTY_BODY = YES; 224 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 225 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 226 | COPY_PHASE_STRIP = NO; 227 | GCC_C_LANGUAGE_STANDARD = gnu99; 228 | GCC_DYNAMIC_NO_PIC = NO; 229 | GCC_OPTIMIZATION_LEVEL = 0; 230 | GCC_PREPROCESSOR_DEFINITIONS = ( 231 | "DEBUG=1", 232 | "$(inherited)", 233 | ); 234 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 235 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 236 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 237 | GCC_WARN_UNUSED_VARIABLE = YES; 238 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 239 | ONLY_ACTIVE_ARCH = YES; 240 | SDKROOT = iphoneos; 241 | }; 242 | name = Debug; 243 | }; 244 | EDAF31A21681799D000A62D9 /* Release */ = { 245 | isa = XCBuildConfiguration; 246 | buildSettings = { 247 | ALWAYS_SEARCH_USER_PATHS = NO; 248 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 249 | CLANG_CXX_LIBRARY = "libc++"; 250 | CLANG_ENABLE_OBJC_ARC = YES; 251 | CLANG_WARN_EMPTY_BODY = YES; 252 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 253 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 254 | COPY_PHASE_STRIP = YES; 255 | GCC_C_LANGUAGE_STANDARD = gnu99; 256 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 257 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 258 | GCC_WARN_UNUSED_VARIABLE = YES; 259 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 260 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 261 | SDKROOT = iphoneos; 262 | VALIDATE_PRODUCT = YES; 263 | }; 264 | name = Release; 265 | }; 266 | EDAF31A41681799D000A62D9 /* Debug */ = { 267 | isa = XCBuildConfiguration; 268 | buildSettings = { 269 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 270 | GCC_PREFIX_HEADER = "OKEasingFunctions/OKEasingFunctions-Prefix.pch"; 271 | INFOPLIST_FILE = "OKEasingFunctions/OKEasingFunctions-Info.plist"; 272 | PRODUCT_NAME = "$(TARGET_NAME)"; 273 | WRAPPER_EXTENSION = app; 274 | }; 275 | name = Debug; 276 | }; 277 | EDAF31A51681799D000A62D9 /* Release */ = { 278 | isa = XCBuildConfiguration; 279 | buildSettings = { 280 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 281 | GCC_PREFIX_HEADER = "OKEasingFunctions/OKEasingFunctions-Prefix.pch"; 282 | INFOPLIST_FILE = "OKEasingFunctions/OKEasingFunctions-Info.plist"; 283 | PRODUCT_NAME = "$(TARGET_NAME)"; 284 | WRAPPER_EXTENSION = app; 285 | }; 286 | name = Release; 287 | }; 288 | /* End XCBuildConfiguration section */ 289 | 290 | /* Begin XCConfigurationList section */ 291 | EDAF31791681799C000A62D9 /* Build configuration list for PBXProject "OKEasingFunctions" */ = { 292 | isa = XCConfigurationList; 293 | buildConfigurations = ( 294 | EDAF31A11681799D000A62D9 /* Debug */, 295 | EDAF31A21681799D000A62D9 /* Release */, 296 | ); 297 | defaultConfigurationIsVisible = 0; 298 | defaultConfigurationName = Release; 299 | }; 300 | EDAF31A31681799D000A62D9 /* Build configuration list for PBXNativeTarget "OKEasingFunctions" */ = { 301 | isa = XCConfigurationList; 302 | buildConfigurations = ( 303 | EDAF31A41681799D000A62D9 /* Debug */, 304 | EDAF31A51681799D000A62D9 /* Release */, 305 | ); 306 | defaultConfigurationIsVisible = 0; 307 | defaultConfigurationName = Release; 308 | }; 309 | /* End XCConfigurationList section */ 310 | }; 311 | rootObject = EDAF31761681799C000A62D9 /* Project object */; 312 | } 313 | -------------------------------------------------------------------------------- /TransformAnimations.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | ED3DB16117505BFA0088359E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED3DB16017505BFA0088359E /* UIKit.framework */; }; 11 | ED3DB16317505BFA0088359E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED3DB16217505BFA0088359E /* Foundation.framework */; }; 12 | ED3DB16517505BFA0088359E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED3DB16417505BFA0088359E /* CoreGraphics.framework */; }; 13 | ED3DB18717505F320088359E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED3DB18617505F320088359E /* QuartzCore.framework */; }; 14 | ED6F72041753D85500358C95 /* NILViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = ED6F72021753D85500358C95 /* NILViewController.xib */; }; 15 | ED76457F1753066B003552FA /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = ED7645701753066B003552FA /* Default-568h@2x.png */; }; 16 | ED7645801753066B003552FA /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = ED7645711753066B003552FA /* Default.png */; }; 17 | ED7645811753066B003552FA /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = ED7645721753066B003552FA /* Default@2x.png */; }; 18 | ED7645841753066B003552FA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ED7645781753066B003552FA /* main.m */; }; 19 | ED7645851753066B003552FA /* NILAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = ED76457A1753066B003552FA /* NILAppDelegate.m */; }; 20 | ED7645861753066B003552FA /* NILViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ED76457C1753066B003552FA /* NILViewController.m */; }; 21 | ED76458E175306AD003552FA /* CAAnimation+EasingEquations.m in Sources */ = {isa = PBXBuildFile; fileRef = ED764589175306AD003552FA /* CAAnimation+EasingEquations.m */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXFileReference section */ 25 | ED3DB15D17505BFA0088359E /* TransformAnimations.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TransformAnimations.app; sourceTree = BUILT_PRODUCTS_DIR; }; 26 | ED3DB16017505BFA0088359E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 27 | ED3DB16217505BFA0088359E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 28 | ED3DB16417505BFA0088359E /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 29 | ED3DB18617505F320088359E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 30 | ED6F72031753D85500358C95 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = TransformAnimations/en.lproj/NILViewController.xib; sourceTree = SOURCE_ROOT; }; 31 | ED7645701753066B003552FA /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "TransformAnimations/Default-568h@2x.png"; sourceTree = SOURCE_ROOT; }; 32 | ED7645711753066B003552FA /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = TransformAnimations/Default.png; sourceTree = SOURCE_ROOT; }; 33 | ED7645721753066B003552FA /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "TransformAnimations/Default@2x.png"; sourceTree = SOURCE_ROOT; }; 34 | ED7645781753066B003552FA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = TransformAnimations/main.m; sourceTree = SOURCE_ROOT; }; 35 | ED7645791753066B003552FA /* NILAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NILAppDelegate.h; path = TransformAnimations/NILAppDelegate.h; sourceTree = SOURCE_ROOT; }; 36 | ED76457A1753066B003552FA /* NILAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NILAppDelegate.m; path = TransformAnimations/NILAppDelegate.m; sourceTree = SOURCE_ROOT; }; 37 | ED76457B1753066B003552FA /* NILViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NILViewController.h; path = TransformAnimations/NILViewController.h; sourceTree = SOURCE_ROOT; }; 38 | ED76457C1753066B003552FA /* NILViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NILViewController.m; path = TransformAnimations/NILViewController.m; sourceTree = SOURCE_ROOT; }; 39 | ED76457D1753066B003552FA /* TransformAnimations-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "TransformAnimations-Info.plist"; path = "TransformAnimations/TransformAnimations-Info.plist"; sourceTree = SOURCE_ROOT; }; 40 | ED76457E1753066B003552FA /* TransformAnimations-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "TransformAnimations-Prefix.pch"; path = "TransformAnimations/TransformAnimations-Prefix.pch"; sourceTree = SOURCE_ROOT; }; 41 | ED764588175306AD003552FA /* CAAnimation+EasingEquations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CAAnimation+EasingEquations.h"; sourceTree = SOURCE_ROOT; }; 42 | ED764589175306AD003552FA /* CAAnimation+EasingEquations.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CAAnimation+EasingEquations.m"; sourceTree = SOURCE_ROOT; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | ED3DB15A17505BFA0088359E /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | ED3DB18717505F320088359E /* QuartzCore.framework in Frameworks */, 51 | ED3DB16117505BFA0088359E /* UIKit.framework in Frameworks */, 52 | ED3DB16317505BFA0088359E /* Foundation.framework in Frameworks */, 53 | ED3DB16517505BFA0088359E /* CoreGraphics.framework in Frameworks */, 54 | ); 55 | runOnlyForDeploymentPostprocessing = 0; 56 | }; 57 | /* End PBXFrameworksBuildPhase section */ 58 | 59 | /* Begin PBXGroup section */ 60 | ED3DB15417505BFA0088359E = { 61 | isa = PBXGroup; 62 | children = ( 63 | ED3DB16617505BFA0088359E /* TransformAnimations */, 64 | ED3DB15F17505BFA0088359E /* Frameworks */, 65 | ED3DB15E17505BFA0088359E /* Products */, 66 | ); 67 | sourceTree = ""; 68 | }; 69 | ED3DB15E17505BFA0088359E /* Products */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | ED3DB15D17505BFA0088359E /* TransformAnimations.app */, 73 | ); 74 | name = Products; 75 | sourceTree = ""; 76 | }; 77 | ED3DB15F17505BFA0088359E /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | ED3DB16417505BFA0088359E /* CoreGraphics.framework */, 81 | ED3DB16217505BFA0088359E /* Foundation.framework */, 82 | ED3DB18617505F320088359E /* QuartzCore.framework */, 83 | ED3DB16017505BFA0088359E /* UIKit.framework */, 84 | ); 85 | name = Frameworks; 86 | sourceTree = ""; 87 | }; 88 | ED3DB16617505BFA0088359E /* TransformAnimations */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | ED764588175306AD003552FA /* CAAnimation+EasingEquations.h */, 92 | ED764589175306AD003552FA /* CAAnimation+EasingEquations.m */, 93 | ED7645791753066B003552FA /* NILAppDelegate.h */, 94 | ED76457A1753066B003552FA /* NILAppDelegate.m */, 95 | ED76457B1753066B003552FA /* NILViewController.h */, 96 | ED76457C1753066B003552FA /* NILViewController.m */, 97 | ED6F72021753D85500358C95 /* NILViewController.xib */, 98 | ED3DB16717505BFA0088359E /* Supporting Files */, 99 | ); 100 | name = TransformAnimations; 101 | path = "Bouncy Tables"; 102 | sourceTree = ""; 103 | }; 104 | ED3DB16717505BFA0088359E /* Supporting Files */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | ED7645701753066B003552FA /* Default-568h@2x.png */, 108 | ED7645711753066B003552FA /* Default.png */, 109 | ED7645721753066B003552FA /* Default@2x.png */, 110 | ED7645781753066B003552FA /* main.m */, 111 | ED76457D1753066B003552FA /* TransformAnimations-Info.plist */, 112 | ED76457E1753066B003552FA /* TransformAnimations-Prefix.pch */, 113 | ); 114 | name = "Supporting Files"; 115 | sourceTree = ""; 116 | }; 117 | /* End PBXGroup section */ 118 | 119 | /* Begin PBXNativeTarget section */ 120 | ED3DB15C17505BFA0088359E /* TransformAnimations */ = { 121 | isa = PBXNativeTarget; 122 | buildConfigurationList = ED3DB18017505BFA0088359E /* Build configuration list for PBXNativeTarget "TransformAnimations" */; 123 | buildPhases = ( 124 | ED3DB15917505BFA0088359E /* Sources */, 125 | ED3DB15A17505BFA0088359E /* Frameworks */, 126 | ED3DB15B17505BFA0088359E /* Resources */, 127 | ); 128 | buildRules = ( 129 | ); 130 | dependencies = ( 131 | ); 132 | name = TransformAnimations; 133 | productName = "Bouncy Tables"; 134 | productReference = ED3DB15D17505BFA0088359E /* TransformAnimations.app */; 135 | productType = "com.apple.product-type.application"; 136 | }; 137 | /* End PBXNativeTarget section */ 138 | 139 | /* Begin PBXProject section */ 140 | ED3DB15517505BFA0088359E /* Project object */ = { 141 | isa = PBXProject; 142 | attributes = { 143 | CLASSPREFIX = NIL; 144 | LastUpgradeCheck = 0460; 145 | ORGANIZATIONNAME = "Bryan Oltman"; 146 | }; 147 | buildConfigurationList = ED3DB15817505BFA0088359E /* Build configuration list for PBXProject "TransformAnimations" */; 148 | compatibilityVersion = "Xcode 3.2"; 149 | developmentRegion = English; 150 | hasScannedForEncodings = 0; 151 | knownRegions = ( 152 | en, 153 | ); 154 | mainGroup = ED3DB15417505BFA0088359E; 155 | productRefGroup = ED3DB15E17505BFA0088359E /* Products */; 156 | projectDirPath = ""; 157 | projectRoot = ""; 158 | targets = ( 159 | ED3DB15C17505BFA0088359E /* TransformAnimations */, 160 | ); 161 | }; 162 | /* End PBXProject section */ 163 | 164 | /* Begin PBXResourcesBuildPhase section */ 165 | ED3DB15B17505BFA0088359E /* Resources */ = { 166 | isa = PBXResourcesBuildPhase; 167 | buildActionMask = 2147483647; 168 | files = ( 169 | ED76457F1753066B003552FA /* Default-568h@2x.png in Resources */, 170 | ED7645801753066B003552FA /* Default.png in Resources */, 171 | ED7645811753066B003552FA /* Default@2x.png in Resources */, 172 | ED6F72041753D85500358C95 /* NILViewController.xib in Resources */, 173 | ); 174 | runOnlyForDeploymentPostprocessing = 0; 175 | }; 176 | /* End PBXResourcesBuildPhase section */ 177 | 178 | /* Begin PBXSourcesBuildPhase section */ 179 | ED3DB15917505BFA0088359E /* Sources */ = { 180 | isa = PBXSourcesBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | ED7645841753066B003552FA /* main.m in Sources */, 184 | ED7645851753066B003552FA /* NILAppDelegate.m in Sources */, 185 | ED7645861753066B003552FA /* NILViewController.m in Sources */, 186 | ED76458E175306AD003552FA /* CAAnimation+EasingEquations.m in Sources */, 187 | ); 188 | runOnlyForDeploymentPostprocessing = 0; 189 | }; 190 | /* End PBXSourcesBuildPhase section */ 191 | 192 | /* Begin PBXVariantGroup section */ 193 | ED6F72021753D85500358C95 /* NILViewController.xib */ = { 194 | isa = PBXVariantGroup; 195 | children = ( 196 | ED6F72031753D85500358C95 /* en */, 197 | ); 198 | name = NILViewController.xib; 199 | sourceTree = ""; 200 | }; 201 | /* End PBXVariantGroup section */ 202 | 203 | /* Begin XCBuildConfiguration section */ 204 | ED3DB17E17505BFA0088359E /* Debug */ = { 205 | isa = XCBuildConfiguration; 206 | buildSettings = { 207 | ALWAYS_SEARCH_USER_PATHS = NO; 208 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 209 | CLANG_CXX_LIBRARY = "libc++"; 210 | CLANG_ENABLE_OBJC_ARC = YES; 211 | CLANG_WARN_CONSTANT_CONVERSION = YES; 212 | CLANG_WARN_EMPTY_BODY = YES; 213 | CLANG_WARN_ENUM_CONVERSION = YES; 214 | CLANG_WARN_INT_CONVERSION = YES; 215 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 216 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 217 | COPY_PHASE_STRIP = NO; 218 | GCC_C_LANGUAGE_STANDARD = gnu99; 219 | GCC_DYNAMIC_NO_PIC = NO; 220 | GCC_OPTIMIZATION_LEVEL = 0; 221 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 222 | GCC_PREPROCESSOR_DEFINITIONS = ( 223 | "DEBUG=1", 224 | "$(inherited)", 225 | ); 226 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 227 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 228 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 229 | GCC_WARN_UNUSED_VARIABLE = YES; 230 | INFOPLIST_FILE = "TransformAnimations/TransformAnimations-Info.plist"; 231 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 232 | ONLY_ACTIVE_ARCH = YES; 233 | SDKROOT = iphoneos; 234 | }; 235 | name = Debug; 236 | }; 237 | ED3DB17F17505BFA0088359E /* Release */ = { 238 | isa = XCBuildConfiguration; 239 | buildSettings = { 240 | ALWAYS_SEARCH_USER_PATHS = NO; 241 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 242 | CLANG_CXX_LIBRARY = "libc++"; 243 | CLANG_ENABLE_OBJC_ARC = YES; 244 | CLANG_WARN_CONSTANT_CONVERSION = YES; 245 | CLANG_WARN_EMPTY_BODY = YES; 246 | CLANG_WARN_ENUM_CONVERSION = YES; 247 | CLANG_WARN_INT_CONVERSION = YES; 248 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 249 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 250 | COPY_PHASE_STRIP = YES; 251 | GCC_C_LANGUAGE_STANDARD = gnu99; 252 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 253 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 254 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 255 | GCC_WARN_UNUSED_VARIABLE = YES; 256 | INFOPLIST_FILE = "TransformAnimations/TransformAnimations-Info.plist"; 257 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 258 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 259 | SDKROOT = iphoneos; 260 | VALIDATE_PRODUCT = YES; 261 | }; 262 | name = Release; 263 | }; 264 | ED3DB18117505BFA0088359E /* Debug */ = { 265 | isa = XCBuildConfiguration; 266 | buildSettings = { 267 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 268 | GCC_PREFIX_HEADER = "TransformAnimations/TransformAnimations-Prefix.pch"; 269 | INFOPLIST_FILE = "TransformAnimations/TransformAnimations-Info.plist"; 270 | PRODUCT_NAME = TransformAnimations; 271 | WRAPPER_EXTENSION = app; 272 | }; 273 | name = Debug; 274 | }; 275 | ED3DB18217505BFA0088359E /* Release */ = { 276 | isa = XCBuildConfiguration; 277 | buildSettings = { 278 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 279 | GCC_PREFIX_HEADER = "TransformAnimations/TransformAnimations-Prefix.pch"; 280 | INFOPLIST_FILE = "TransformAnimations/TransformAnimations-Info.plist"; 281 | PRODUCT_NAME = TransformAnimations; 282 | WRAPPER_EXTENSION = app; 283 | }; 284 | name = Release; 285 | }; 286 | /* End XCBuildConfiguration section */ 287 | 288 | /* Begin XCConfigurationList section */ 289 | ED3DB15817505BFA0088359E /* Build configuration list for PBXProject "TransformAnimations" */ = { 290 | isa = XCConfigurationList; 291 | buildConfigurations = ( 292 | ED3DB17E17505BFA0088359E /* Debug */, 293 | ED3DB17F17505BFA0088359E /* Release */, 294 | ); 295 | defaultConfigurationIsVisible = 0; 296 | defaultConfigurationName = Release; 297 | }; 298 | ED3DB18017505BFA0088359E /* Build configuration list for PBXNativeTarget "TransformAnimations" */ = { 299 | isa = XCConfigurationList; 300 | buildConfigurations = ( 301 | ED3DB18117505BFA0088359E /* Debug */, 302 | ED3DB18217505BFA0088359E /* Release */, 303 | ); 304 | defaultConfigurationIsVisible = 0; 305 | defaultConfigurationName = Release; 306 | }; 307 | /* End XCConfigurationList section */ 308 | }; 309 | rootObject = ED3DB15517505BFA0088359E /* Project object */; 310 | } 311 | -------------------------------------------------------------------------------- /CAAnimation+EasingEquations.m: -------------------------------------------------------------------------------- 1 | // 2 | // CAAnimation+EasingEquations.m 3 | // OKEasingFunctions 4 | // 5 | // Created by Bryan Oltman on 12/18/12. 6 | // Copyright (c) 2012 Bryan Oltman. All rights reserved. 7 | // 8 | 9 | #import "CAAnimation+EasingEquations.h" 10 | 11 | #define kAnimationStops 250 12 | 13 | // Thanks to http://www.dzone.com/snippets/robert-penner-easing-equations for the easing 14 | // equation implementations 15 | typedef CGFloat (^EasingFunction)(CGFloat, CGFloat, CGFloat, CGFloat); 16 | 17 | // Generally: 18 | // t: current time 19 | // b: beginning value 20 | // c: change in value 21 | // d: duration 22 | // 23 | // Each of these equations returns the animated property's value at time t 24 | static EasingFunction linear = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 25 | t /= d; 26 | return c * t + b; 27 | }; 28 | 29 | ///////////// QUADRATIC EASING: t^2 /////////////////// 30 | static EasingFunction easeInQuad = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 31 | t /= d; 32 | return c * t * t + b; 33 | }; 34 | 35 | static EasingFunction easeOutQuad = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 36 | t /= d; 37 | return -c * t * (t - 2) + b; 38 | }; 39 | 40 | static EasingFunction easeInOutQuad = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 41 | t /= d / 2; 42 | if (t < 1) { 43 | return c/2*t*t + b; 44 | } 45 | 46 | return -c/2 * ((t-1)*(t-3) - 1) + b; 47 | }; 48 | 49 | ///////////// CUBIC EASING: t^3 /////////////////////// 50 | static EasingFunction easeInCubic = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 51 | t /= d; 52 | return c*t*t*t + b; 53 | }; 54 | 55 | static EasingFunction easeOutCubic = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 56 | t = t/d - 1; 57 | return c*(t*t*t + 1) + b; 58 | }; 59 | 60 | static EasingFunction easeInOutCubic = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 61 | t /= d / 2; 62 | if (t < 1) { 63 | return c/2*t*t*t + b; 64 | } 65 | 66 | t -= 2; 67 | return c/2*(t*t*t + 2) + b; 68 | }; 69 | 70 | ///////////// QUARTIC EASING: t^4 ///////////////////// 71 | static EasingFunction easeInQuart = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 72 | t /= d; 73 | return c*t*t*t*t + b; 74 | }; 75 | 76 | static EasingFunction easeOutQuart = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 77 | t = t/d - 1; 78 | return -c * (t*t*t*t - 1) + b; 79 | }; 80 | 81 | static EasingFunction easeInOutQuart = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 82 | t /= d / 2; 83 | if (t < 1) { 84 | return c/2*t*t*t*t + b; 85 | } 86 | 87 | t -= 2; 88 | return -c / 2 * (t*t*t*t - 2) + b; 89 | }; 90 | 91 | ///////////// QUINTIC EASING: t^5 //////////////////// 92 | static EasingFunction easeOutQuint = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 93 | t = t/d - 1; 94 | return c*(t*t*t*t*t + 1) + b; 95 | }; 96 | 97 | static EasingFunction easeInQuint = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 98 | t /= d; 99 | return c*t*t*t*t*t + b; 100 | }; 101 | 102 | static EasingFunction easeInOutQuint = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 103 | t /= d / 2; 104 | if (t < 1) { 105 | return c/2*t*t*t*t*t + b; 106 | } 107 | 108 | t -= 2; 109 | return c/2*(t*t*t*t*t + 2) + b; 110 | }; 111 | 112 | ///////////// SINUSOIDAL EASING: sin(t) /////////////// 113 | static EasingFunction easeInSine = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 114 | return -c * cos(t/d * (M_PI/2)) + c + b; 115 | }; 116 | 117 | static EasingFunction easeOutSine = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 118 | return c * sin(t/d * (M_PI/2)) + b; 119 | }; 120 | 121 | static EasingFunction easeInOutSine = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 122 | return -c/2 * (cos(M_PI*t/d) - 1) + b; 123 | }; 124 | 125 | ///////////// EXPONENTIAL EASING: 2^t ///////////////// 126 | static EasingFunction easeInExpo = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 127 | return (t==0) ? b : c * pow(2, 10 * (t/d - 1)) + b; 128 | }; 129 | 130 | static EasingFunction easeOutExpo = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 131 | return (t==d) ? b+c : c * (-pow(2, -10 * t/d) + 1) + b; 132 | }; 133 | 134 | static EasingFunction easeInOutExpo = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 135 | if (t == 0) { 136 | return b; 137 | } 138 | 139 | if (t == d) { 140 | return b+c; 141 | } 142 | 143 | t /= d / 2; 144 | 145 | if (t < 1) { 146 | return c/2 * pow(2, 10 * (t - 1)) + b; 147 | } 148 | 149 | --t; 150 | return c/2 * (-pow(2, -10 * t) + 2) + b; 151 | }; 152 | 153 | /////////// CIRCULAR EASING: sqrt(1-t^2) ////////////// 154 | static EasingFunction easeInCirc = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 155 | t /= d; 156 | return -c * (sqrt(1 - t*t) - 1) + b; 157 | }; 158 | 159 | static EasingFunction easeOutCirc = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 160 | t = t / d - 1; 161 | return c * sqrt(1 - t*t) + b; 162 | }; 163 | 164 | static EasingFunction easeInOutCirc = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 165 | t /= d / 2; 166 | if (t < 1) { 167 | return -c/2 * (sqrt(1 - t*t) - 1) + b; 168 | } 169 | 170 | t -= 2; 171 | return c/2 * (sqrt(1 - t*t) + 1) + b; 172 | }; 173 | 174 | /////////// ELASTIC EASING: exponentially decaying sine wave ////////////// 175 | static EasingFunction easeInElastic = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 176 | if (!c) return b; 177 | 178 | CGFloat amplitude = 5; 179 | CGFloat period = 0.3; 180 | CGFloat s = 0; 181 | 182 | if (t == 0) return b; 183 | 184 | t /= d; 185 | 186 | if (t == 1) return b+c; 187 | 188 | if (!period) { 189 | period = d * .3; 190 | } 191 | 192 | if (amplitude < fabs(c)) { 193 | amplitude = c; 194 | s = period / 4; 195 | } 196 | else { 197 | s = period/(2*M_PI) * asin (c/amplitude); 198 | } 199 | 200 | t -= 1; 201 | return -(amplitude*pow(2,10*t) * sin( (t*d-s)*(2*M_PI)/period )) + b; 202 | }; 203 | 204 | static EasingFunction easeOutElastic = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 205 | if (!c) return b; 206 | 207 | CGFloat amplitude = 5; 208 | CGFloat period = 0.3; 209 | CGFloat s = 0; 210 | if (t == 0) { 211 | return b; 212 | } 213 | 214 | t /= d; 215 | if (t == 1) { 216 | return b + c; 217 | } 218 | 219 | if (!period) { 220 | period = d * .3; 221 | } 222 | 223 | if (amplitude < fabs(c)) { 224 | amplitude = c; 225 | s = period / 4; 226 | } 227 | else { 228 | s = period / (2 * M_PI) * sin(c / amplitude); 229 | } 230 | 231 | return (amplitude * pow(2, -10 * t) * sin((t * d - s) * (2 * M_PI) / period) + c + b); 232 | }; 233 | 234 | static EasingFunction easeInOutElastic = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 235 | if (!c) return b; 236 | 237 | CGFloat amplitude = 5; 238 | CGFloat period = 0.3; 239 | CGFloat s = 0; 240 | 241 | if (t == 0) return b; 242 | 243 | t /= d / 2; 244 | if (t == 2) { 245 | return b + c; 246 | } 247 | 248 | if (!period) { 249 | period = d * (.3 * 1.5); 250 | } 251 | 252 | if (amplitude < fabs(c)) { 253 | amplitude = c; 254 | s = period / 4; 255 | } 256 | else { 257 | s = period / (2 * M_PI) * asin (c / amplitude); 258 | } 259 | 260 | if (t < 1) { 261 | return -.5*(amplitude*pow(2,10*(t-1)) * sin( ((t-1)*d-s)*(2*M_PI)/period )) + b; 262 | } 263 | 264 | return amplitude * pow(2,-10*(t-1)) * sin( ((t-1)*d-s)*(2*M_PI)/period )*.5 + c + b; 265 | }; 266 | 267 | ///////////// BACK EASING: overshooting cubic easing: (s+1)*t^3 - s*t^2 ////////////// 268 | //// s controls the amount of overshoot: higher s means greater overshoot 269 | //// s has a default value of 1.70158, which produces an overshoot of 10 percent 270 | //// s==0 produces cubic easing with no overshoot 271 | static EasingFunction easeInBack = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 272 | CGFloat s = 1.70158; 273 | t /= d; 274 | return c*t*t*((s+1)*t - s) + b; 275 | }; 276 | 277 | static EasingFunction easeOutBack = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 278 | CGFloat s = 1.70158; 279 | t = t/d - 1; 280 | return c*(t*t*((s+1)*t + s) + 1) + b; 281 | }; 282 | 283 | static EasingFunction easeInOutBack = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 284 | CGFloat s = 1.70158 * 1.525; 285 | t /= d / 2; 286 | if (t < 1) { 287 | return c/2*(t*t*((s + 1)*t - s)) + b; 288 | } 289 | 290 | t -= 2; 291 | return c/2 * (t * t * ((s + 1) * t + s) + 2) + b; 292 | }; 293 | 294 | ///////////// BOUNCE EASING: exponentially decaying parabolic bounce ////////////// 295 | static EasingFunction easeOutBounce = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 296 | t /= d; 297 | if (t < (1 / 2.75)) { 298 | return c * (7.5625 * t * t) + b; 299 | } 300 | 301 | if (t < (2 / 2.75)) { 302 | t -= (1.5 / 2.75); 303 | return c * (7.5625 * t * t + 0.75) + b; 304 | } 305 | 306 | if (t < (2.5 / 2.75)) { 307 | t -= (2.25 / 2.75); 308 | return c * (7.5625 * t * t + 0.9375) + b; 309 | } 310 | 311 | t -= (2.625 / 2.75); 312 | return c * (7.5625 * t * t + 0.984375) + b; 313 | }; 314 | 315 | static EasingFunction easeInBounce = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 316 | return c - easeOutBounce(d-t, 0, c, d) + b; 317 | }; 318 | 319 | static EasingFunction easeInOutBounce = ^CGFloat(CGFloat t, CGFloat b, CGFloat c, CGFloat d) { 320 | if (t < d/2) return easeInBounce (t*2, 0, c, d) * .5 + b; 321 | return easeOutBounce (t*2-d, 0, c, d) * .5 + c*.5 + b; 322 | }; 323 | 324 | 325 | @implementation CAAnimation (EasingEquations) 326 | 327 | + (EasingFunction)blockForCAAnimationEasingFunction:(CAAnimationEasingFunction)easingFunction 328 | { 329 | static NSDictionary *easingFunctionsToBlocks = nil; 330 | if (!easingFunctionsToBlocks) { 331 | easingFunctionsToBlocks = @{ 332 | @(CAAnimationEasingFunctionLinear) : linear, 333 | 334 | @(CAAnimationEasingFunctionEaseInQuad) : easeInQuad, 335 | @(CAAnimationEasingFunctionEaseOutQuad) : easeOutQuad, 336 | @(CAAnimationEasingFunctionEaseInOutQuad) : easeInOutQuad, 337 | 338 | @(CAAnimationEasingFunctionEaseInCubic) : easeInCubic, 339 | @(CAAnimationEasingFunctionEaseOutCubic) : easeOutCubic, 340 | @(CAAnimationEasingFunctionEaseInOutCubic) : easeInOutCubic, 341 | 342 | @(CAAnimationEasingFunctionEaseInQuartic) : easeInQuart, 343 | @(CAAnimationEasingFunctionEaseOutQuartic) : easeOutQuart, 344 | @(CAAnimationEasingFunctionEaseInOutQuartic) : easeInOutQuart, 345 | 346 | @(CAAnimationEasingFunctionEaseInQuintic) : easeInQuint, 347 | @(CAAnimationEasingFunctionEaseOutQuintic) : easeOutQuint, 348 | @(CAAnimationEasingFunctionEaseInOutQuintic) : easeInOutQuint, 349 | 350 | @(CAAnimationEasingFunctionEaseInSine) : easeInSine, 351 | @(CAAnimationEasingFunctionEaseOutSine) : easeOutSine, 352 | @(CAAnimationEasingFunctionEaseInOutSine) : easeInOutSine, 353 | 354 | @(CAAnimationEasingFunctionEaseInExponential) : easeInExpo, 355 | @(CAAnimationEasingFunctionEaseOutExponential) : easeOutExpo, 356 | @(CAAnimationEasingFunctionEaseInOutExponential) : easeInOutExpo, 357 | 358 | @(CAAnimationEasingFunctionEaseInCircular) : easeInCirc, 359 | @(CAAnimationEasingFunctionEaseOutCircular) : easeOutCirc, 360 | @(CAAnimationEasingFunctionEaseInOutCircular) : easeInOutCirc, 361 | 362 | @(CAAnimationEasingFunctionEaseInElastic) : easeInElastic, 363 | @(CAAnimationEasingFunctionEaseOutElastic) : easeOutElastic, 364 | @(CAAnimationEasingFunctionEaseInOutElastic) : easeInOutElastic, 365 | 366 | @(CAAnimationEasingFunctionEaseInBack) : easeInBack, 367 | @(CAAnimationEasingFunctionEaseOutBack) : easeOutBack, 368 | @(CAAnimationEasingFunctionEaseInOutBack) : easeInOutBack, 369 | 370 | @(CAAnimationEasingFunctionEaseInBounce) : easeInBounce, 371 | @(CAAnimationEasingFunctionEaseOutBounce) : easeOutBounce, 372 | @(CAAnimationEasingFunctionEaseInOutBounce) : easeInOutBounce 373 | }; 374 | } 375 | 376 | return [easingFunctionsToBlocks objectForKey:@(easingFunction)]; 377 | } 378 | 379 | + (CAKeyframeAnimation*)transformAnimationWithDuration:(CGFloat)duration 380 | from:(CATransform3D)startValue 381 | to:(CATransform3D)endValue 382 | easingFunction:(CAAnimationEasingFunction)easingFunction 383 | { 384 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 385 | animation.duration = duration; 386 | animation.fillMode = kCAFillModeForwards; 387 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 388 | animation.removedOnCompletion = NO; 389 | 390 | NSMutableArray *values = [NSMutableArray arrayWithCapacity:kAnimationStops]; 391 | 392 | CGFloat dm11 = endValue.m11 - startValue.m11; 393 | CGFloat dm12 = endValue.m12 - startValue.m12; 394 | CGFloat dm13 = endValue.m13 - startValue.m13; 395 | CGFloat dm14 = endValue.m14 - startValue.m14; 396 | 397 | CGFloat dm21 = endValue.m21 - startValue.m21; 398 | CGFloat dm22 = endValue.m22 - startValue.m22; 399 | CGFloat dm23 = endValue.m23 - startValue.m23; 400 | CGFloat dm24 = endValue.m24 - startValue.m24; 401 | 402 | CGFloat dm31 = endValue.m31 - startValue.m31; 403 | CGFloat dm32 = endValue.m32 - startValue.m32; 404 | CGFloat dm33 = endValue.m33 - startValue.m33; 405 | CGFloat dm34 = endValue.m34 - startValue.m34; 406 | 407 | CGFloat dm41 = endValue.m41 - startValue.m41; 408 | CGFloat dm42 = endValue.m42 - startValue.m42; 409 | CGFloat dm43 = endValue.m43 - startValue.m43; 410 | CGFloat dm44 = endValue.m44 - startValue.m44; 411 | 412 | EasingFunction function = [CAAnimation blockForCAAnimationEasingFunction:easingFunction]; 413 | for (CGFloat t = 0; t < kAnimationStops; t++) { 414 | CATransform3D tr; 415 | tr.m11 = function(animation.duration * (t / kAnimationStops), 416 | startValue.m11, dm11, animation.duration); 417 | tr.m12 = function(animation.duration * (t / kAnimationStops), 418 | startValue.m12, dm12, animation.duration); 419 | tr.m13 = function(animation.duration * (t / kAnimationStops), 420 | startValue.m13, dm13, animation.duration); 421 | tr.m14 = function(animation.duration * (t / kAnimationStops), 422 | startValue.m14, dm14, animation.duration); 423 | 424 | tr.m21 = function(animation.duration * (t / kAnimationStops), 425 | startValue.m21, dm21, animation.duration); 426 | tr.m22 = function(animation.duration * (t / kAnimationStops), 427 | startValue.m22, dm22, animation.duration); 428 | tr.m23 = function(animation.duration * (t / kAnimationStops), 429 | startValue.m23, dm23, animation.duration); 430 | tr.m24 = function(animation.duration * (t / kAnimationStops), 431 | startValue.m24, dm24, animation.duration); 432 | 433 | tr.m31 = function(animation.duration * (t / kAnimationStops), 434 | startValue.m31, dm31, animation.duration); 435 | tr.m32 = function(animation.duration * (t / kAnimationStops), 436 | startValue.m32, dm32, animation.duration); 437 | tr.m33 = function(animation.duration * (t / kAnimationStops), 438 | startValue.m33, dm33, animation.duration); 439 | tr.m34 = function(animation.duration * (t / kAnimationStops), 440 | startValue.m34, dm34, animation.duration); 441 | 442 | tr.m41 = function(animation.duration * (t / kAnimationStops), 443 | startValue.m41, dm41, animation.duration); 444 | tr.m42 = function(animation.duration * (t / kAnimationStops), 445 | startValue.m42, dm42, animation.duration); 446 | tr.m43 = function(animation.duration * (t / kAnimationStops), 447 | startValue.m43, dm43, animation.duration); 448 | tr.m44 = function(animation.duration * (t / kAnimationStops), 449 | startValue.m44, dm44, animation.duration); 450 | [values addObject:[NSValue valueWithCATransform3D:tr]]; 451 | } 452 | 453 | [values addObject:[NSValue valueWithCATransform3D:endValue]]; 454 | animation.values = values; 455 | return animation; 456 | } 457 | 458 | + (void)addAnimationToLayer:(CALayer *)layer 459 | duration:(CGFloat)duration 460 | transform:(CATransform3D)transform 461 | easingFunction:(CAAnimationEasingFunction)easingFunction 462 | { 463 | CAAnimation *animation = [self transformAnimationWithDuration:duration 464 | from:layer.transform 465 | to:transform 466 | easingFunction:easingFunction]; 467 | layer.transform = transform; 468 | [layer addAnimation:animation forKey:nil]; 469 | } 470 | 471 | + (CAKeyframeAnimation*)animationWithKeyPath:(NSString*)keyPath 472 | duration:(CGFloat)duration 473 | from:(CGFloat)startValue 474 | to:(CGFloat)endValue 475 | easingFunction:(CAAnimationEasingFunction)easingFunction 476 | { 477 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:keyPath]; 478 | animation.duration = duration; 479 | animation.fillMode = kCAFillModeForwards; 480 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 481 | animation.removedOnCompletion = NO; 482 | 483 | NSMutableArray *values = [NSMutableArray arrayWithCapacity:kAnimationStops]; 484 | CGFloat delta = endValue - startValue; 485 | EasingFunction function = [CAAnimation blockForCAAnimationEasingFunction:easingFunction]; 486 | for (CGFloat t = 0; t < kAnimationStops; t++) { 487 | [values addObject:@(function(animation.duration * (t / kAnimationStops), 488 | startValue, delta, animation.duration))]; 489 | } 490 | 491 | [values addObject:@(endValue)]; 492 | animation.values = values; 493 | return animation; 494 | } 495 | 496 | + (void)addAnimationToLayer:(CALayer *)layer 497 | withKeyPath:(NSString *)keyPath 498 | duration:(CGFloat)duration 499 | to:(CGFloat)endValue 500 | easingFunction:(CAAnimationEasingFunction)easingFunction 501 | { 502 | [self addAnimationToLayer:layer 503 | withKeyPath:keyPath 504 | duration:duration 505 | from:[[layer valueForKeyPath:keyPath] floatValue] 506 | to:endValue 507 | easingFunction:easingFunction]; 508 | } 509 | 510 | + (void)addAnimationToLayer:(CALayer *)layer 511 | withKeyPath:(NSString *)keyPath 512 | duration:(CGFloat)duration 513 | from:(CGFloat)startValue 514 | to:(CGFloat)endValue 515 | easingFunction:(CAAnimationEasingFunction)easingFunction 516 | { 517 | CAAnimation *animation = [self animationWithKeyPath:keyPath 518 | duration:duration 519 | from:startValue 520 | to:endValue 521 | easingFunction:easingFunction]; 522 | [layer addAnimation:animation forKey:nil]; 523 | [layer setValue:@(endValue) forKey:keyPath]; 524 | } 525 | 526 | @end 527 | --------------------------------------------------------------------------------