├── .gitignore ├── Classes ├── CoreAnimation │ ├── AVPlayerLayerViewController.h │ ├── AVPlayerLayerViewController.m │ ├── BatmanViewController.h │ ├── BatmanViewController.m │ ├── CALayer+Additions.h │ ├── CALayer+Additions.m │ ├── ImplicitAnimationsViewController.h │ ├── ImplicitAnimationsViewController.m │ ├── MakeItStickViewController.h │ ├── MakeItStickViewController.m │ ├── NSAViewController.h │ ├── NSAViewController.m │ ├── PacmanViewController.h │ ├── PacmanViewController.m │ ├── PulseViewController.h │ ├── PulseViewController.m │ ├── ReflectionViewController.h │ ├── ReflectionViewController.m │ ├── SublayerTransformViewController.h │ ├── SublayerTransformViewController.m │ ├── TachometerViewController.h │ └── TachometerViewController.m ├── CoreAnimationAppDelegate.h ├── CoreAnimationAppDelegate.m ├── RootViewController.h ├── RootViewController.m └── UIKitAnimation │ ├── FlipViewController.h │ ├── FlipViewController.m │ ├── NoteView.h │ ├── NoteView.m │ ├── SimpleViewPropertyAnimation.h │ ├── SimpleViewPropertyAnimation.m │ ├── StickyNotesViewController.h │ └── StickyNotesViewController.m ├── CoreAnimation-Info.plist ├── CoreAnimation.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── CoreAnimation.xccheckout ├── CoreAnimation_Prefix.pch ├── README.md ├── Resources ├── Audio │ └── engine.caf ├── Images │ ├── BatmanButton.png │ ├── BatmanButton@2x.png │ ├── BobMcCune.png │ ├── Default-568h@2x.png │ ├── arrow-down.png │ ├── arrow-left.png │ ├── arrow-right.png │ ├── arrow-up.png │ ├── backView.png │ ├── batman.png │ ├── batman@2x.png │ ├── caLogo.png │ ├── corkboard.png │ ├── heart.png │ ├── mountains.png │ ├── new_note_icon.png │ ├── obama.png │ ├── pattern.png │ ├── pin.png │ ├── pin@2x.png │ ├── tach.png │ └── tach@2x.png ├── Videos │ └── cyborg.m4v └── XIBs │ ├── BatmanView.xib │ ├── CoreAnimationView.xib │ ├── LayerView.xib │ ├── MainWindow.xib │ └── RootViewController.xib └── main.m /.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/ -------------------------------------------------------------------------------- /Classes/CoreAnimation/AVPlayerLayerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | @class AVPlayer; 26 | 27 | /* 28 | * Demo of moving AVPlayerLayer around in 3D space. 29 | */ 30 | @interface AVPlayerLayerViewController : UIViewController 31 | 32 | @property (nonatomic, strong) AVPlayer *player; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/AVPlayerLayerViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "AVPlayerLayerViewController.h" 26 | #import 27 | 28 | @implementation AVPlayerLayerViewController 29 | 30 | + (NSString *)displayName { 31 | return @"Amazon Babe"; 32 | } 33 | 34 | - (void)viewDidLoad { 35 | [super viewDidLoad]; 36 | self.edgesForExtendedLayout = UIRectEdgeNone; 37 | self.title = [[self class] displayName]; 38 | self.view.backgroundColor = [UIColor colorWithRed:0.972 green:0.134 blue:0.173 alpha:1.000]; 39 | self.view.tintColor = [UIColor whiteColor]; 40 | 41 | // Setup AVPlayer 42 | // Hilarious video from the guys at http://www.thekeyofawesome.com/ 43 | NSString *moviePath = [[NSBundle mainBundle] pathForResource:@"cyborg" ofType:@"m4v"]; 44 | self.player = [AVPlayer playerWithURL:[NSURL fileURLWithPath:moviePath]]; 45 | [self.player play]; 46 | 47 | // Create and configure AVPlayerLayer 48 | AVPlayerLayer *playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player]; 49 | playerLayer.bounds = CGRectMake(0, 0, 300, 170); 50 | playerLayer.position = CGPointMake(160, 150); 51 | playerLayer.borderColor = [UIColor whiteColor].CGColor; 52 | playerLayer.borderWidth = 3.0; 53 | playerLayer.shadowOffset = CGSizeMake(0, 3); 54 | playerLayer.shadowOpacity = 0.80; 55 | 56 | // Add perspective transform 57 | self.view.layer.sublayerTransform = CATransform3DMakePerspective(1000); 58 | [self.view.layer addSublayer:playerLayer]; 59 | 60 | // Set up slider used to rotate video around Y-axis 61 | UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(60, 300, 200, 23)]; 62 | slider.minimumValue = -1.0; 63 | slider.maximumValue = 1.0; 64 | slider.continuous = NO; 65 | slider.value = 0.0; 66 | [slider addTarget:self action:@selector(sliderValueChanged:) forControlEvents:UIControlEventTouchDragInside]; 67 | [self.view addSubview:slider]; 68 | 69 | // Spin button to spin the video around the X-axis 70 | UIButton *spinButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 71 | spinButton.frame = CGRectMake(0, 0, 50, 31); 72 | spinButton.center = CGPointMake(160, 350); 73 | [spinButton setTitle:@"Spin" forState:UIControlStateNormal]; 74 | [spinButton addTarget:self action:@selector(spinIt) forControlEvents:UIControlEventTouchUpInside]; 75 | [self.view addSubview:spinButton]; 76 | 77 | } 78 | 79 | // Rotate the layer around the Y-axis as slider value is changed 80 | -(IBAction)sliderValueChanged:(UISlider *)sender{ 81 | CALayer *layer = [self.view.layer sublayers][0]; 82 | layer.transform = CATransform3DMakeRotation([sender value], 0, 1, 0); 83 | } 84 | 85 | // Animate spinning video around X-axis 86 | - (void)spinIt { 87 | CALayer *layer = [self.view.layer sublayers][0]; 88 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.x"]; 89 | animation.duration = 1.25f; 90 | animation.toValue = @(DEGREES_TO_RADIANS(360)); 91 | [layer addAnimation:animation forKey:@"spinAnimation"]; 92 | } 93 | 94 | - (void)dealloc { 95 | [self.player pause]; 96 | } 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/BatmanViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | /* 26 | * Demo showing how to animate transforms and combine multiple animations into a CAAnimationGroup. 27 | */ 28 | @interface BatmanViewController : UIViewController 29 | 30 | - (IBAction)rotate:(id)sender; 31 | - (IBAction)scaleUp; 32 | - (IBAction)scaleDown; 33 | - (IBAction)doBatmanAnimation; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/BatmanViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "BatmanViewController.h" 26 | 27 | #define ROTATE_LEFT_TAG 3 28 | #define ROTATE_RIGHT_TAG 4 29 | 30 | @interface BatmanViewController () 31 | @property (nonatomic, strong) CALayer *logoLayer; 32 | @end 33 | 34 | @implementation BatmanViewController 35 | 36 | - (id)init { 37 | self = [super initWithNibName:@"BatmanView" bundle:nil]; 38 | if (self) { 39 | self.edgesForExtendedLayout = UIRectEdgeNone; 40 | } 41 | return self; 42 | } 43 | 44 | + (NSString *)displayName { 45 | return @"I'm Batman"; 46 | } 47 | 48 | - (void)viewDidLoad { 49 | [super viewDidLoad]; 50 | self.view.backgroundColor = [UIColor blackColor]; 51 | self.title = [[self class] displayName]; 52 | 53 | UIImage *image = [UIImage imageNamed:@"batman.png"]; 54 | 55 | self.logoLayer = [CALayer layer]; 56 | self.logoLayer.bounds = CGRectMake(0, 0, image.size.width, image.size.height); 57 | self.logoLayer.position = CGPointMake(160, 180); 58 | self.logoLayer.contents = (id)image.CGImage; 59 | 60 | // Add layer as a sublayer of the UIView's layer 61 | [self.view.layer addSublayer:self.logoLayer]; 62 | } 63 | 64 | - (IBAction)rotate:(id)sender { 65 | int direction = [sender tag] == ROTATE_LEFT_TAG ? -1 : 1; 66 | CABasicAnimation* rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; 67 | rotationAnimation.toValue = @((2 * M_PI) * direction); 68 | rotationAnimation.duration = 1.0f; 69 | rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 70 | [self.logoLayer addAnimation:rotationAnimation forKey:@"rotateAnimation"]; 71 | } 72 | 73 | - (void)scaleByFactor:(CGFloat)factor { 74 | CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; 75 | NSNumber *scaleFactor = @(factor); 76 | scaleAnimation.toValue = scaleFactor; 77 | scaleAnimation.duration = 3.0f; 78 | scaleAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 79 | // Set the model layer's property so the animation sticks at the 'toValue' state 80 | [self.logoLayer setValue:scaleFactor forKeyPath:@"transform.scale"]; 81 | [self.logoLayer addAnimation:scaleAnimation forKey:@"transformAnimation"]; 82 | } 83 | 84 | - (IBAction)scaleDown { 85 | CGFloat factor = [[self.logoLayer valueForKeyPath:@"transform.scale"] floatValue] > 1.0 ? 1.0 : 0.5; 86 | [self scaleByFactor:factor]; 87 | } 88 | 89 | - (IBAction)scaleUp { 90 | CGFloat factor = [[self.logoLayer valueForKeyPath:@"transform.scale"] floatValue] == 0.5 ? 1.0 : 1.5; 91 | [self scaleByFactor:factor]; 92 | } 93 | 94 | // Combine scale and rotate transform into group. Let animation group repeat indefinitely 95 | - (IBAction)doBatmanAnimation { 96 | CABasicAnimation* rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; 97 | rotationAnimation.toValue = @((2 * M_PI) * 3); // 3 is the number of 360 degree rotations 98 | // Make the rotation animation duration slightly less than the other animations to give it the feel 99 | // that it pauses at its largest scale value 100 | rotationAnimation.duration = 1.9f; 101 | rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 102 | 103 | CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; 104 | scaleAnimation.fromValue = @0.0f; 105 | scaleAnimation.toValue = @1.0f; 106 | scaleAnimation.duration = 2.0f; 107 | scaleAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 108 | 109 | CAAnimationGroup *animationGroup = [CAAnimationGroup animation]; 110 | animationGroup.duration = 2.0f; 111 | animationGroup.autoreverses = YES; 112 | animationGroup.repeatCount = 0; 113 | [animationGroup setAnimations:@[rotationAnimation, scaleAnimation]]; 114 | 115 | [self.logoLayer addAnimation:animationGroup forKey:@"animationGroup"]; 116 | } 117 | 118 | @end 119 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/CALayer+Additions.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | @interface CALayer (Additions) 26 | 27 | - (void)adjustWidthBy:(CGFloat)value; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/CALayer+Additions.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "CALayer+Additions.h" 26 | 27 | @implementation CALayer (Additions) 28 | 29 | - (void)adjustWidthBy:(CGFloat)value { 30 | self.bounds = CGRectMake(self.bounds.origin.x, self.bounds.origin.y, self.bounds.size.width + value, self.bounds.size.height); 31 | } 32 | 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/ImplicitAnimationsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | /* 26 | * Simple demo showing implicit property animations. 27 | */ 28 | @interface ImplicitAnimationsViewController : UIViewController 29 | 30 | @property (nonatomic, strong) IBOutlet UISwitch *actionsSwitch; 31 | @property (strong, nonatomic) IBOutletCollection(id) NSArray *buttons; 32 | 33 | - (IBAction)toggleCornerRadius; 34 | - (IBAction)toggleBorder; 35 | - (IBAction)toggleOpacity; 36 | - (IBAction)toggleColor; 37 | - (IBAction)toggleBounds; 38 | - (IBAction)togglePosition; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/ImplicitAnimationsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "ImplicitAnimationsViewController.h" 26 | #import 27 | #import "CALayer+Additions.h" 28 | 29 | #define ORGINAL_POSITION CGPointMake(160, 250) 30 | #define MOVED_POSITON CGPointMake(200, 290) 31 | 32 | @interface ImplicitAnimationsViewController () 33 | @property (nonatomic, strong) CALayer *layer; 34 | @end 35 | 36 | @implementation ImplicitAnimationsViewController 37 | 38 | + (NSString *)displayName { 39 | return @"Animatable Properties"; 40 | } 41 | 42 | - (id)init { 43 | if ((self = [super initWithNibName:@"LayerView" bundle:nil])) { 44 | self.layer = [CALayer layer]; 45 | self.layer.bounds = CGRectMake(0, 0, 200, 200); 46 | self.layer.position = CGPointMake(160, 250); 47 | self.layer.backgroundColor = [UIColor redColor].CGColor; 48 | self.layer.borderColor = [UIColor blackColor].CGColor; 49 | self.layer.opacity = 1.0f; 50 | [self.view.layer addSublayer:self.layer]; 51 | } 52 | return self; 53 | } 54 | 55 | - (void)viewDidLoad { 56 | [super viewDidLoad]; 57 | self.edgesForExtendedLayout = UIRectEdgeNone; 58 | self.actionsSwitch.on = NO; 59 | self.title = [[self class] displayName]; 60 | 61 | for (UIButton *button in self.buttons) { 62 | button.layer.cornerRadius = 8.0f; 63 | button.layer.borderWidth = 1.0f; 64 | button.layer.borderColor = [UIColor colorWithRed:0.083 green:0.394 blue:0.979 alpha:1.000].CGColor; 65 | } 66 | 67 | } 68 | 69 | - (IBAction)toggleColor { 70 | [CATransaction setDisableActions:self.actionsSwitch.on]; 71 | CGColorRef redColor = [UIColor redColor].CGColor, blueColor = [UIColor blueColor].CGColor; 72 | self.layer.backgroundColor = (self.layer.backgroundColor == redColor) ? blueColor : redColor; 73 | } 74 | 75 | - (IBAction)toggleCornerRadius { 76 | [CATransaction setDisableActions:self.actionsSwitch.on]; 77 | self.layer.cornerRadius = (self.layer.cornerRadius == 0.0f) ? 30.0f : 0.0f; 78 | } 79 | 80 | - (IBAction)toggleBorder { 81 | [CATransaction setDisableActions:self.actionsSwitch.on]; 82 | self.layer.borderWidth = (self.layer.borderWidth == 0.0f) ? 10.0f : 0.0f; 83 | } 84 | 85 | - (IBAction)toggleOpacity { 86 | [CATransaction setDisableActions:self.actionsSwitch.on]; 87 | self.layer.opacity = (self.layer.opacity == 1.0f) ? 0.5f : 1.0f; 88 | } 89 | 90 | - (IBAction)toggleBounds { 91 | [CATransaction setDisableActions:self.actionsSwitch.on]; 92 | [self.layer adjustWidthBy:self.layer.bounds.size.width == self.layer.bounds.size.height ? 100 : -100]; 93 | } 94 | 95 | - (IBAction)togglePosition { 96 | [CATransaction setDisableActions:self.actionsSwitch.on]; 97 | self.layer.position = self.layer.position.x == 160 ? MOVED_POSITON : ORGINAL_POSITION; 98 | } 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/MakeItStickViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | /* 26 | * Demo pointing out a gotcha when applying animations. Need to update the model value to ensure 27 | * the animation's 'toValue' sticks. 28 | */ 29 | @interface MakeItStickViewController : UIViewController 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/MakeItStickViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "MakeItStickViewController.h" 26 | 27 | @interface MakeItStickViewController () 28 | @property (nonatomic, strong) CALayer *layer; 29 | @end 30 | 31 | @implementation MakeItStickViewController 32 | 33 | + (NSString *)displayName { 34 | return @"Make it Stick"; 35 | } 36 | 37 | - (void)viewDidLoad { 38 | [super viewDidLoad]; 39 | self.edgesForExtendedLayout = UIRectEdgeNone; 40 | self.title = [[self class] displayName]; 41 | UIImage *image = [UIImage imageNamed:@"heart"]; 42 | self.layer = [CALayer layer]; 43 | self.layer.contents = (id)image.CGImage; 44 | self.layer.bounds = CGRectMake(0, 0, image.size.width, image.size.height); 45 | self.layer.position = CGPointMake(160, 200); 46 | [self.view.layer addSublayer:self.layer]; 47 | 48 | UIGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fadeIt)]; 49 | [self.view addGestureRecognizer:recognizer]; 50 | } 51 | 52 | - (void)fadeIt { 53 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"opacity"]; 54 | animation.toValue = @0.0f; 55 | animation.fromValue = @(self.layer.opacity); 56 | animation.duration = 1.0; 57 | self.layer.opacity = 0.0; // This is required to update the model's value. Comment out to see what happens. 58 | [self.layer addAnimation:animation forKey:@"animateOpacity"]; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/NSAViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | /* 26 | * Demo using shadowPath property to give greater depth and realism to layers. Tap photo to toggle shadow path. 27 | */ 28 | @interface NSAViewController : UIViewController 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/NSAViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "NSAViewController.h" 26 | 27 | static const CGFloat offset = 15.0; 28 | static const CGFloat curve = 3.0; 29 | 30 | @interface NSAViewController () 31 | @property (strong, nonatomic) CALayer *layer; 32 | @end 33 | 34 | @implementation NSAViewController 35 | 36 | + (NSString *)displayName { 37 | return @"NSA Blues"; 38 | } 39 | 40 | // This method taken verbatim from Joe Ricciopo's Shadow Demo: 41 | // https://github.com/joericioppo/ShadowDemo 42 | 43 | - (UIBezierPath*)bezierPathWithCurvedShadowForRect:(CGRect)rect { 44 | 45 | UIBezierPath *path = [UIBezierPath bezierPath]; 46 | 47 | CGPoint topLeft = rect.origin; 48 | CGPoint bottomLeft = CGPointMake(0.0, CGRectGetHeight(rect) + offset); 49 | CGPoint bottomMiddle = CGPointMake(CGRectGetWidth(rect)/2, CGRectGetHeight(rect) - curve); 50 | CGPoint bottomRight = CGPointMake(CGRectGetWidth(rect), CGRectGetHeight(rect) + offset); 51 | CGPoint topRight = CGPointMake(CGRectGetWidth(rect), 0.0); 52 | 53 | [path moveToPoint:topLeft]; 54 | [path addLineToPoint:bottomLeft]; 55 | [path addQuadCurveToPoint:bottomRight controlPoint:bottomMiddle]; 56 | [path addLineToPoint:topRight]; 57 | [path addLineToPoint:topLeft]; 58 | [path closePath]; 59 | 60 | return path; 61 | } 62 | 63 | - (void)viewDidLoad { 64 | [super viewDidLoad]; 65 | self.edgesForExtendedLayout = UIRectEdgeNone; 66 | self.view.backgroundColor = [UIColor whiteColor]; 67 | self.title = [[self class] displayName]; 68 | 69 | [self addInstructionLabel]; 70 | 71 | UIImage *obamaImage = [UIImage imageNamed:@"obama"]; 72 | 73 | self.layer = [CALayer layer]; 74 | self.layer.bounds = CGRectMake(0, 0, obamaImage.size.width, obamaImage.size.height); 75 | self.layer.position = CGPointMake(160, 220); 76 | self.layer.contents = (id)obamaImage.CGImage; 77 | 78 | if (self.view.bounds.size.height < 658) { 79 | self.layer.transform = CATransform3DMakeScale(0.85, 0.85, 1.0); 80 | } 81 | 82 | self.layer.shadowOffset = CGSizeMake(0, 3); 83 | self.layer.shadowOpacity = 0.80; 84 | self.layer.shadowRadius = 6.0f; 85 | self.layer.shadowColor = [UIColor darkGrayColor].CGColor; 86 | 87 | [self.view.layer addSublayer:self.layer]; 88 | 89 | UIGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(togglePath)]; 90 | [self.view addGestureRecognizer:tapRecognizer]; 91 | } 92 | 93 | - (void)addInstructionLabel { 94 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero]; 95 | label.text = @"Tap Image"; 96 | label.textColor = [UIColor blackColor]; 97 | [label sizeToFit]; 98 | 99 | CGFloat x = (self.view.bounds.size.width - label.bounds.size.width) / 2; 100 | label.frame = CGRectMake(x, 20, label.bounds.size.width, label.bounds.size.height); 101 | [self.view addSubview:label]; 102 | } 103 | 104 | - (void)togglePath { 105 | self.layer.shadowPath = (self.layer.shadowPath) ? nil : [self bezierPathWithCurvedShadowForRect:self.layer.bounds].CGPath; 106 | } 107 | 108 | @end 109 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/PacmanViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | /* 26 | * 80's flashback demo showing how to animate a CAShape layer using CABasicAnimation and CAKeyframeAnimation. 27 | */ 28 | @interface PacmanViewController : UIViewController 29 | 30 | @end 31 | 32 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/PacmanViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "PacmanViewController.h" 26 | 27 | @interface PacmanViewController () 28 | @property (nonatomic, strong) CAShapeLayer *shapeLayer; 29 | @property (nonatomic, strong) UIBezierPath *pacmanOpenPath; 30 | @property (nonatomic, strong) UIBezierPath *pacmanClosedPath; 31 | @end 32 | 33 | @implementation PacmanViewController 34 | 35 | + (NSString *)displayName { 36 | return @"CAcman"; 37 | } 38 | 39 | - (void)viewDidLoad { 40 | [super viewDidLoad]; 41 | self.edgesForExtendedLayout = UIRectEdgeNone; 42 | self.title = [[self class] displayName]; 43 | 44 | self.view.backgroundColor = [UIColor blackColor]; 45 | 46 | CGFloat radius = 30.0f; 47 | CGFloat diameter = radius * 2; 48 | CGPoint arcCenter = CGPointMake(radius, radius); 49 | 50 | // Create a UIBezierPath for Pacman's open state 51 | self.pacmanOpenPath = [UIBezierPath bezierPathWithArcCenter:arcCenter 52 | radius:radius 53 | startAngle:DEGREES_TO_RADIANS(35) 54 | endAngle:DEGREES_TO_RADIANS(315) 55 | clockwise:YES]; 56 | [self.pacmanOpenPath addLineToPoint:arcCenter]; 57 | [self.pacmanOpenPath closePath]; 58 | 59 | // Create a UIBezierPath for Pacman's close state 60 | self.pacmanClosedPath = [UIBezierPath bezierPathWithArcCenter:arcCenter 61 | radius:radius 62 | startAngle:DEGREES_TO_RADIANS(1) 63 | endAngle:DEGREES_TO_RADIANS(359) 64 | clockwise:YES]; 65 | [self.pacmanClosedPath addLineToPoint:arcCenter]; 66 | [self.pacmanClosedPath closePath]; 67 | 68 | // Create a CAself.shapeLayer for Pacman, fill with yellow 69 | self.shapeLayer = [CAShapeLayer layer]; 70 | self.shapeLayer.fillColor = [UIColor colorWithRed:0.990 green:0.916 blue:0.137 alpha:1.000].CGColor; 71 | self.shapeLayer.path = self.pacmanClosedPath.CGPath; 72 | self.shapeLayer.strokeColor = [UIColor grayColor].CGColor; 73 | self.shapeLayer.lineWidth = 1.0f; 74 | self.shapeLayer.bounds = CGRectMake(0, 0, diameter, diameter); 75 | self.shapeLayer.position = CGPointMake(-40, -100); 76 | [self.view.layer addSublayer:self.shapeLayer]; 77 | 78 | SEL startSelector = @selector(startAnimation); 79 | UIGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:startSelector]; 80 | [self.view addGestureRecognizer:recognizer]; 81 | 82 | // start animation after short delay 83 | [self performSelector:startSelector withObject:nil afterDelay:1.0]; 84 | } 85 | 86 | - (void)startAnimation { 87 | 88 | // Create CHOMP CHOMP animation 89 | CABasicAnimation *chompAnimation = [CABasicAnimation animationWithKeyPath:@"path"]; 90 | chompAnimation.duration = 0.25; 91 | chompAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 92 | chompAnimation.repeatCount = HUGE_VALF; 93 | chompAnimation.autoreverses = YES; 94 | // Animate between the two path values 95 | chompAnimation.fromValue = (id)self.pacmanClosedPath.CGPath; 96 | chompAnimation.toValue = (id)self.pacmanOpenPath.CGPath; 97 | 98 | [self.shapeLayer addAnimation:chompAnimation forKey:@"chompAnimation"]; 99 | 100 | // Create digital '2'-shaped path 101 | UIBezierPath *path = [UIBezierPath bezierPath]; 102 | [path moveToPoint:CGPointMake(-40, 100)]; 103 | [path addLineToPoint:CGPointMake(360, 100)]; 104 | [path addLineToPoint:CGPointMake(360, 200)]; 105 | [path addLineToPoint:CGPointMake(-40, 200)]; 106 | [path addLineToPoint:CGPointMake(-40, 300)]; 107 | [path addLineToPoint:CGPointMake(360, 300)]; 108 | 109 | CAKeyframeAnimation *moveAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; 110 | moveAnimation.path = path.CGPath; 111 | moveAnimation.duration = 8.0f; 112 | // Setting the rotation mode ensures Pacman's mouth is always forward. This is a very convenient CA feature. 113 | moveAnimation.rotationMode = kCAAnimationRotateAuto; 114 | [self.shapeLayer addAnimation:moveAnimation forKey:@"moveAnimation"]; 115 | } 116 | 117 | 118 | @end 119 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/PulseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | /* 26 | * Simple CABasicAnimation demo to give a pulsing/throbbing effect 27 | */ 28 | @interface PulseViewController : UIViewController 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/PulseViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "PulseViewController.h" 26 | 27 | @implementation PulseViewController 28 | 29 | + (NSString *)displayName { 30 | return @"Pulse"; 31 | } 32 | 33 | - (void)viewDidLoad { 34 | [super viewDidLoad]; 35 | self.edgesForExtendedLayout = UIRectEdgeNone; 36 | self.title = [[self class] displayName]; 37 | 38 | UIImage *image = [UIImage imageNamed:@"heart.png"]; 39 | CALayer *layer = [CALayer layer]; 40 | layer.contents = (id)image.CGImage; 41 | layer.bounds = CGRectMake(0, 0, image.size.width, image.size.height); 42 | layer.position = CGPointMake(160, 200); 43 | 44 | // Shrink down to 90% of its original value 45 | layer.transform = CATransform3DMakeScale(0.90, 0.90, 1); 46 | 47 | [self.view.layer addSublayer:layer]; 48 | 49 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"]; 50 | animation.toValue = [NSValue valueWithCATransform3D:CATransform3DIdentity]; 51 | animation.autoreverses = YES; 52 | animation.duration = 0.35; 53 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 54 | animation.repeatCount = HUGE_VALF; 55 | [layer addAnimation:animation forKey:@"pulseAnimation"]; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/ReflectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | /* 26 | * Demo showing how to produce reflection effects by compositing layers. 27 | */ 28 | @interface ReflectionViewController : UIViewController 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/ReflectionViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "ReflectionViewController.h" 26 | 27 | @implementation ReflectionViewController 28 | 29 | + (NSString *)displayName { 30 | return @"Reflections"; 31 | } 32 | 33 | - (void)viewDidLoad { 34 | [super viewDidLoad]; 35 | self.edgesForExtendedLayout = UIRectEdgeNone; 36 | self.title = [[self class] displayName]; 37 | self.view.backgroundColor = [UIColor whiteColor]; 38 | UIImage *image = [UIImage imageNamed:@"mountains.png"]; 39 | 40 | // Image Layer 41 | CALayer *imageLayer = [CALayer layer]; 42 | imageLayer.contents = (id)image.CGImage; 43 | imageLayer.bounds = CGRectMake(0, 0, image.size.width, image.size.height); 44 | imageLayer.position = CGPointMake(160, 130); 45 | imageLayer.borderColor = [UIColor darkGrayColor].CGColor; 46 | imageLayer.borderWidth = 1.0; 47 | [self.view.layer addSublayer:imageLayer]; 48 | 49 | // Reflection Layer 50 | CALayer *reflectionLayer = [CALayer layer]; 51 | reflectionLayer.contents = imageLayer.contents; 52 | reflectionLayer.bounds = imageLayer.bounds; 53 | reflectionLayer.position = CGPointMake(160, 330); 54 | reflectionLayer.borderColor = imageLayer.borderColor; 55 | reflectionLayer.borderWidth = imageLayer.borderWidth; 56 | reflectionLayer.opacity = 0.5; 57 | // Transform X by 180 degrees 58 | [reflectionLayer setValue:@(DEGREES_TO_RADIANS(180)) forKeyPath:@"transform.rotation.x"]; 59 | 60 | // Gradient Layer - Use as mask 61 | CAGradientLayer *gradientLayer = [CAGradientLayer layer]; 62 | gradientLayer.bounds = reflectionLayer.bounds; 63 | gradientLayer.position = CGPointMake(reflectionLayer.bounds.size.width / 2, reflectionLayer.bounds.size.height * 0.65); 64 | gradientLayer.colors = @[(id)[UIColor clearColor].CGColor,(id)[UIColor whiteColor].CGColor]; 65 | gradientLayer.startPoint = CGPointMake(0.5, 0.5); 66 | gradientLayer.endPoint = CGPointMake(0.5, 1.0); 67 | 68 | // Add gradient layer as a mask 69 | reflectionLayer.mask = gradientLayer; 70 | [self.view.layer addSublayer:reflectionLayer]; 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/SublayerTransformViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | /* 26 | * Demo showing moving layers around in 3D space. 27 | */ 28 | @interface SublayerTransformViewController : UIViewController 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/SublayerTransformViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "SublayerTransformViewController.h" 26 | 27 | @interface SublayerTransformViewController () 28 | @property (nonatomic, strong) CALayer *rootLayer; 29 | @end 30 | 31 | @implementation SublayerTransformViewController 32 | 33 | + (NSString *)displayName { 34 | return @"Sublayer Transforms"; 35 | } 36 | 37 | - (void)addLayersWithColors:(NSArray *)colors { 38 | 39 | for (UIColor *color in colors) { 40 | CALayer *layer = [CALayer layer]; 41 | layer.backgroundColor = color.CGColor; 42 | layer.bounds = CGRectMake(0, 0, 200, 200); 43 | layer.position = CGPointMake(160, 190); 44 | layer.opacity = 0.80; 45 | layer.cornerRadius = 10; 46 | layer.borderColor = [UIColor whiteColor].CGColor; 47 | layer.borderWidth = 1.0; 48 | layer.shadowOffset = CGSizeMake(0, 2); 49 | layer.shadowOpacity = 0.35; 50 | layer.shadowColor = [UIColor darkGrayColor].CGColor; 51 | layer.shouldRasterize = YES; 52 | [self.rootLayer addSublayer:layer]; 53 | } 54 | } 55 | 56 | - (void)viewDidLoad { 57 | [super viewDidLoad]; 58 | self.edgesForExtendedLayout = UIRectEdgeNone; 59 | self.title = [[self class] displayName]; 60 | 61 | self.rootLayer = [CALayer layer]; 62 | // Apply perspective transform 63 | self.rootLayer.sublayerTransform = CATransform3DMakePerspective(1000); 64 | self.rootLayer.frame = self.view.bounds; 65 | [self.view.layer addSublayer:self.rootLayer]; 66 | 67 | NSArray *colors = @[[UIColor colorWithRed:0.263 green:0.769 blue:0.319 alpha:1.000], [UIColor colorWithRed:0.990 green:0.759 blue:0.145 alpha:1.000], [UIColor colorWithRed:0.084 green:0.398 blue:0.979 alpha:1.000]]; 68 | [self addLayersWithColors:colors]; 69 | 70 | [self performSelector:@selector(rotateLayers) withObject:nil afterDelay:1.0]; 71 | } 72 | 73 | - (void)rotateLayers { 74 | 75 | // Create basic animation to rotate around the Y and Z axes 76 | CABasicAnimation *transformAnimation = [CABasicAnimation animationWithKeyPath:@"transform"]; 77 | transformAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DIdentity]; 78 | transformAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(DEGREES_TO_RADIANS(85), 0, 1, 1)]; 79 | transformAnimation.duration = 1.5; 80 | transformAnimation.autoreverses = YES; 81 | transformAnimation.repeatCount = HUGE_VALF; 82 | transformAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 83 | 84 | int tx = 0; 85 | // Loop through the sublayers and attach the animations 86 | for (CALayer *layer in [self.rootLayer sublayers]) { 87 | [layer addAnimation:transformAnimation forKey:nil]; 88 | 89 | // Create animation to translate along the X axis 90 | CABasicAnimation *translateAnimation = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"]; 91 | translateAnimation.fromValue = [NSValue valueWithCATransform3D:layer.transform]; 92 | translateAnimation.toValue = [NSNumber numberWithFloat:tx]; 93 | translateAnimation.duration = 1.5; 94 | translateAnimation.autoreverses = YES; 95 | translateAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 96 | translateAnimation.repeatCount = HUGE_VALF; 97 | [layer addAnimation:translateAnimation forKey:nil]; 98 | tx += 35; 99 | } 100 | } 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/TachometerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | /* 26 | * Demo showing CABasicAnimation to animate a rotation transform. 27 | */ 28 | @interface TachometerViewController : UIViewController 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Classes/CoreAnimation/TachometerViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "TachometerViewController.h" 26 | #import 27 | 28 | @interface TachometerViewController () 29 | 30 | @property (nonatomic, strong) CALayer *pinLayer; 31 | @property (nonatomic, strong) CALayer *tachLayer; 32 | @property (nonatomic, strong) AVAudioPlayer *audioPlayer; 33 | 34 | @end 35 | 36 | @implementation TachometerViewController 37 | 38 | + (NSString *)displayName { 39 | return @"Start Me Up"; 40 | } 41 | 42 | - (void)viewDidLoad { 43 | [super viewDidLoad]; 44 | self.edgesForExtendedLayout = UIRectEdgeNone; 45 | self.title = [[self class] displayName]; 46 | 47 | self.view.backgroundColor = [UIColor colorWithWhite:0.661 alpha:1.000]; 48 | // The animation was fun without the audio, but it's WAY better with the engine rev sound. 49 | NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"engine" ofType:@"caf"]]; 50 | self.audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil]; 51 | [self.audioPlayer prepareToPlay]; 52 | 53 | // Create the tach's background layer 54 | self.tachLayer = [CALayer layer]; 55 | self.tachLayer.bounds = CGRectMake(0, 0, 300, 300); 56 | self.tachLayer.position = CGPointMake(160, 200); 57 | self.tachLayer.contents = (id)[UIImage imageNamed:@"tach"].CGImage; 58 | [self.view.layer addSublayer:self.tachLayer]; 59 | 60 | // Create the layer for the pin 61 | self.pinLayer = [CALayer layer]; 62 | self.pinLayer.bounds = CGRectMake(0, 0, 68, 49); 63 | self.pinLayer.contents = (id)[UIImage imageNamed:@"pin"].CGImage; 64 | self.pinLayer.position = CGPointMake(152, 148); 65 | self.pinLayer.anchorPoint = CGPointMake(1.0, 1.0); 66 | // Rotate to the left 50 degrees so it lines up with the 0 position on the gauge 67 | self.pinLayer.transform = CATransform3DRotate(self.pinLayer.transform, DEGREES_TO_RADIANS(-50), 0, 0, 1); 68 | [self.tachLayer addSublayer:self.pinLayer]; 69 | 70 | UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 71 | [button setTitle:@"REV IT!" forState:UIControlStateNormal]; 72 | button.titleLabel.font = [UIFont boldSystemFontOfSize:20]; 73 | [button sizeToFit]; 74 | CGRect rect = button.bounds; 75 | rect.origin.x = (self.view.bounds.size.width - rect.size.width) / 2; 76 | rect.origin.y = 380; 77 | button.frame = rect; 78 | [button addTarget:self action:@selector(go:) forControlEvents:UIControlEventTouchUpInside]; 79 | [self.view addSubview:button]; 80 | } 81 | 82 | - (void)go:(id)sender { 83 | [self.audioPlayer play]; 84 | CABasicAnimation* rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; 85 | rotationAnimation.toValue = @(DEGREES_TO_RADIANS(160)); 86 | rotationAnimation.duration = 1.0f; 87 | rotationAnimation.autoreverses = YES; // Very convenient CA feature for an animation like this 88 | rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 89 | [self.pinLayer addAnimation:rotationAnimation forKey:@"revItUpAnimation"]; 90 | } 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /Classes/CoreAnimationAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | @interface CoreAnimationAppDelegate : NSObject 26 | 27 | @property (nonatomic, strong) IBOutlet UIWindow *window; 28 | @property (nonatomic, strong) IBOutlet UINavigationController *navigationController; 29 | 30 | @end 31 | 32 | -------------------------------------------------------------------------------- /Classes/CoreAnimationAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "CoreAnimationAppDelegate.h" 26 | #import "RootViewController.h" 27 | 28 | @implementation CoreAnimationAppDelegate 29 | 30 | #pragma mark - 31 | #pragma mark Application lifecycle 32 | 33 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 34 | 35 | // Set the navigationController as the window's root view controller 36 | self.window.rootViewController = self.navigationController; 37 | self.window.backgroundColor = [UIColor whiteColor]; 38 | [self.window makeKeyAndVisible]; 39 | 40 | return YES; 41 | } 42 | 43 | @end 44 | 45 | -------------------------------------------------------------------------------- /Classes/RootViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | @interface RootViewController : UITableViewController 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Classes/RootViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "RootViewController.h" 26 | 27 | #import "TachometerViewController.h" 28 | #import "BatmanViewController.h" 29 | #import "PacmanViewController.h" 30 | #import "ImplicitAnimationsViewController.h" 31 | #import "NSAViewController.h" 32 | #import "SimpleViewPropertyAnimation.h" 33 | #import "StickyNotesViewController.h" 34 | #import "AVPlayerLayerViewController.h" 35 | #import "ReflectionViewController.h" 36 | #import "FlipViewController.h" 37 | #import "PulseViewController.h" 38 | #import "MakeItStickViewController.h" 39 | #import "SublayerTransformViewController.h" 40 | 41 | @interface UIViewController () 42 | + (NSString *)displayName; 43 | @end 44 | 45 | @interface RootViewController () 46 | @property (nonatomic, strong) NSMutableArray *items; 47 | @end 48 | 49 | @implementation RootViewController 50 | 51 | #pragma mark - 52 | #pragma mark View lifecycle 53 | 54 | - (void)viewDidLoad { 55 | [super viewDidLoad]; 56 | 57 | self.items = [NSMutableArray array]; 58 | 59 | NSMutableArray *layersList = [NSMutableArray array]; 60 | [layersList addObject:[ImplicitAnimationsViewController class]]; 61 | [layersList addObject:[MakeItStickViewController class]]; 62 | [layersList addObject:[TachometerViewController class]]; 63 | [layersList addObject:[BatmanViewController class]]; 64 | [layersList addObject:[PacmanViewController class]]; 65 | [layersList addObject:[SublayerTransformViewController class]]; 66 | [layersList addObject:[AVPlayerLayerViewController class]]; 67 | [layersList addObject:[NSAViewController class]]; 68 | [layersList addObject:[ReflectionViewController class]]; 69 | [layersList addObject:[PulseViewController class]]; 70 | 71 | NSDictionary *layers = @{@"Core Animation": layersList}; 72 | [self.items addObject:layers]; 73 | 74 | NSMutableArray *uiKitList = [NSMutableArray array]; 75 | [uiKitList addObject:[SimpleViewPropertyAnimation class]]; 76 | [uiKitList addObject:[StickyNotesViewController class]]; 77 | [uiKitList addObject:[FlipViewController class]]; 78 | 79 | 80 | NSDictionary *uiKits = @{@"UIKit Animation": uiKitList}; 81 | [self.items addObject:uiKits]; 82 | 83 | self.title = @"Animations"; 84 | } 85 | 86 | #pragma mark - 87 | #pragma mark Table view data source 88 | 89 | - (NSArray *)valuesForSection:(NSUInteger)section { 90 | NSDictionary *dictionary = (self.items)[section]; 91 | NSString *key = [dictionary allKeys][0]; 92 | return dictionary[key]; 93 | } 94 | 95 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 96 | return [(self.items)[section] allKeys][0]; 97 | } 98 | 99 | // Customize the number of sections in the table view. 100 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 101 | return [self.items count]; 102 | } 103 | 104 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 105 | return [[self valuesForSection:section] count]; 106 | } 107 | 108 | // Customize the appearance of table view cells. 109 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 110 | 111 | static NSString *CellIdentifier = @"Cell"; 112 | 113 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 114 | if (cell == nil) { 115 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 116 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 117 | } 118 | 119 | 120 | NSArray *values = [self valuesForSection:indexPath.section]; 121 | cell.textLabel.text = [values[indexPath.row] displayName]; 122 | 123 | return cell; 124 | } 125 | 126 | #pragma mark - 127 | #pragma mark Table view delegate 128 | 129 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 130 | NSArray *values = [self valuesForSection:indexPath.section]; 131 | Class clazz = values[indexPath.row]; 132 | id controller = [[clazz alloc] init]; 133 | [self.navigationController pushViewController:controller animated:YES]; 134 | } 135 | 136 | @end 137 | -------------------------------------------------------------------------------- /Classes/UIKitAnimation/FlipViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | @interface FlipViewController : UIViewController 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Classes/UIKitAnimation/FlipViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "FlipViewController.h" 26 | 27 | @interface FlipViewController () 28 | @property (nonatomic, strong) UIView *frontView; 29 | @property (nonatomic, strong) UIImageView *backView; 30 | @property (nonatomic) BOOL displayingFrontView; 31 | @end 32 | 33 | @implementation FlipViewController 34 | 35 | + (NSString *)displayName { 36 | return @"Flip Views"; 37 | } 38 | 39 | - (void)viewDidLoad { 40 | [super viewDidLoad]; 41 | self.edgesForExtendedLayout = UIRectEdgeNone; 42 | self.title = [[self class] displayName]; 43 | // Set the background color for the window. The user will see the window's background color on the transition. 44 | UIColor *backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"pattern.png"]]; 45 | [UIApplication sharedApplication].keyWindow.backgroundColor = backgroundColor; 46 | 47 | self.frontView = [[UIView alloc] initWithFrame:self.view.bounds]; 48 | self.frontView.backgroundColor = [UIColor colorWithRed:0.345 green:0.349 blue:0.365 alpha:1.000]; 49 | UIImageView *caLogoView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"caLogo.png"]]; 50 | caLogoView.frame = CGRectMake(70, 80, caLogoView.bounds.size.width, caLogoView.bounds.size.height); 51 | 52 | [self.frontView addSubview:caLogoView]; 53 | 54 | UIImage *backImage = [UIImage imageNamed:@"backView.png"]; 55 | self.backView = [[UIImageView alloc] initWithImage:backImage]; 56 | self.backView.userInteractionEnabled = YES; 57 | 58 | [self.view addSubview:self.backView]; 59 | [self.view addSubview:self.frontView]; 60 | 61 | self.displayingFrontView = YES; 62 | 63 | UIGestureRecognizer *frontViewTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(flipViews)]; 64 | UIGestureRecognizer *backViewTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(flipViews)]; 65 | [self.frontView addGestureRecognizer:frontViewTapRecognizer]; 66 | [self.backView addGestureRecognizer:backViewTapRecognizer]; 67 | } 68 | 69 | - (void)viewWillDisappear:(BOOL)animated { 70 | [super viewWillDisappear:animated]; 71 | [UIApplication sharedApplication].keyWindow.backgroundColor = [UIColor whiteColor]; 72 | } 73 | 74 | - (void)flipViews { 75 | [UIView transitionFromView:(self.displayingFrontView) ? self.frontView : self.backView 76 | toView:(self.displayingFrontView) ? self.backView : self.frontView 77 | duration:0.75 78 | options:(self.displayingFrontView ? UIViewAnimationOptionTransitionFlipFromRight : UIViewAnimationOptionTransitionFlipFromLeft) 79 | completion:^(BOOL finished) { 80 | if (finished) { 81 | self.displayingFrontView = !self.displayingFrontView; 82 | } 83 | }]; 84 | } 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /Classes/UIKitAnimation/NoteView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | @interface NoteView : UIView 26 | 27 | @property (nonatomic, weak) id delegate; 28 | @property (nonatomic, copy) NSString *text; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Classes/UIKitAnimation/NoteView.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "NoteView.h" 26 | 27 | @interface NoteView () 28 | @property (nonatomic, strong) UITextView *textView; 29 | @end 30 | 31 | @implementation NoteView 32 | 33 | - (id)initWithFrame:(CGRect)frame { 34 | self = [super initWithFrame:frame]; 35 | if (self) { 36 | UIColor *greenBackgroundColor = [UIColor colorWithRed:0.733 green:0.976 blue:0.722 alpha:1.000]; 37 | self.backgroundColor = greenBackgroundColor; 38 | self.layer.borderColor = [UIColor colorWithRed:0.513 green:0.688 blue:0.505 alpha:1.000].CGColor; 39 | self.layer.borderWidth = 1.0f; 40 | 41 | // Add Text View 42 | self.textView = [[UITextView alloc] initWithFrame:CGRectMake(10, 10, self.bounds.size.width - 20, self.bounds.size.height - 44)]; 43 | self.textView.editable = NO; 44 | self.textView.font = [UIFont fontWithName:@"Marker Felt" size:36]; 45 | self.textView.textColor = [UIColor colorWithWhite:0.200 alpha:1.000]; 46 | self.textView.backgroundColor = [UIColor clearColor]; 47 | [self addSubview:self.textView]; 48 | 49 | // Add New Button 50 | UIImage *newNoteImage = [UIImage imageNamed:@"new_note_icon"]; 51 | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; 52 | button.frame = CGRectMake(self.bounds.size.width - 34, self.bounds.size.height - 36, 24, 26); 53 | [button setBackgroundImage:newNoteImage forState:UIControlStateNormal]; 54 | [button addTarget:self action:@selector(addNote) forControlEvents:UIControlEventTouchUpInside]; 55 | [self addSubview:button]; 56 | } 57 | return self; 58 | } 59 | 60 | - (void)addNote { 61 | if ([self.delegate respondsToSelector:@selector(addNoteTapped)]) { 62 | [self.delegate performSelector:@selector(addNoteTapped)]; 63 | } 64 | } 65 | 66 | - (NSString *)text { 67 | return [self.textView text]; 68 | } 69 | 70 | - (void)setText:(NSString *)newText { 71 | [self.textView setText:newText]; 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /Classes/UIKitAnimation/SimpleViewPropertyAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | @interface SimpleViewPropertyAnimation : UIViewController 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Classes/UIKitAnimation/SimpleViewPropertyAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "SimpleViewPropertyAnimation.h" 26 | 27 | @interface SimpleViewPropertyAnimation () 28 | @property (nonatomic, strong) UIView *fadeMeView; 29 | @property (nonatomic, strong) UIView *moveMeView; 30 | @end 31 | 32 | @implementation SimpleViewPropertyAnimation 33 | 34 | + (NSString *)displayName { 35 | return @"Block-based Animations"; 36 | } 37 | 38 | - (UIGestureRecognizer *)createTapRecognizerWithSelector:(SEL)selector { 39 | return [[UITapGestureRecognizer alloc] initWithTarget:self action:selector]; 40 | } 41 | 42 | - (void)viewDidLoad { 43 | [super viewDidLoad]; 44 | self.edgesForExtendedLayout = UIRectEdgeNone; 45 | 46 | self.title = [[self class] displayName]; 47 | 48 | self.fadeMeView = [[UIView alloc] initWithFrame:CGRectMake(55, 40, 210, 160)]; 49 | self.fadeMeView.backgroundColor = [UIColor colorWithRed:0.580 green:0.706 blue:0.796 alpha:1.000]; 50 | [self.view addSubview:self.fadeMeView]; 51 | 52 | self.moveMeView = [[UIView alloc] initWithFrame:CGRectMake(55, 220, 210, 160)]; 53 | self.moveMeView.backgroundColor = [UIColor colorWithRed:1.000 green:0.400 blue:0.400 alpha:1.000]; 54 | [self.view addSubview:self.moveMeView]; 55 | 56 | [self.fadeMeView addGestureRecognizer:[self createTapRecognizerWithSelector:@selector(fadeMe)]]; 57 | [self.moveMeView addGestureRecognizer:[self createTapRecognizerWithSelector:@selector(moveMe)]]; 58 | } 59 | 60 | - (void)fadeMe { 61 | [UIView animateWithDuration:1.0 animations:^{ 62 | self.fadeMeView.alpha = 0.0f; 63 | }]; 64 | } 65 | 66 | - (void)moveMe { 67 | [UIView animateWithDuration:0.5 animations:^{ 68 | self.moveMeView.center = CGPointMake(self.moveMeView.center.x, self.moveMeView.center.y - 200); 69 | }]; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /Classes/UIKitAnimation/StickyNotesViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | @class NoteView; 26 | 27 | @interface StickyNotesViewController : UIViewController 28 | 29 | @property (nonatomic, strong) NoteView *noteView; 30 | @property (nonatomic, copy) NSString *nextText; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Classes/UIKitAnimation/StickyNotesViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2012 Bob McCune http://bobmccune.com/ 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "StickyNotesViewController.h" 26 | #import "NoteView.h" 27 | 28 | @implementation StickyNotesViewController 29 | 30 | + (NSString *)displayName { 31 | return @"Sticky Notes"; 32 | } 33 | 34 | - (void)viewDidLoad { 35 | [super viewDidLoad]; 36 | self.edgesForExtendedLayout = UIRectEdgeNone; 37 | self.title = [[self class] displayName]; 38 | self.noteView = [[NoteView alloc] initWithFrame:CGRectMake(0, 0, 280, 300)]; 39 | self.noteView.delegate = self; 40 | self.noteView.text = @"A computer once beat me at chess, but it was no match for me at kick boxing.\n-Emo Philips"; 41 | self.nextText = @"A lot of people are afraid of heights. Not me, I'm afraid of widths.\n-Steven Wright"; 42 | 43 | UIImage *corkboard = [UIImage imageNamed:@"corkboard.png"]; 44 | self.view.backgroundColor = [UIColor colorWithPatternImage:corkboard]; 45 | 46 | // Shadow needs to be applied to the containing layer so it doesn't blip when the animation occurs. 47 | // Hat tip to Troy for pointing that out! 48 | UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(20, 20, 280, 300)]; 49 | containerView.backgroundColor = [UIColor clearColor]; 50 | containerView.layer.shadowOffset = CGSizeMake(0, 2); 51 | containerView.layer.shadowOpacity = 0.80; 52 | [containerView addSubview:self.noteView]; 53 | [self.view addSubview:containerView]; 54 | } 55 | 56 | - (void)addNoteTapped { 57 | [UIView transitionWithView:self.noteView duration:0.6 58 | options:UIViewAnimationOptionTransitionCurlUp 59 | animations:^{ 60 | NSString *currentText = self.noteView.text; 61 | self.noteView.text = self.nextText; 62 | self.nextText = currentText; 63 | } completion:^(BOOL finished){ 64 | 65 | }]; 66 | } 67 | 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /CoreAnimation-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | BobMcCune.png 13 | CFBundleIdentifier 14 | com.tapharmonic.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | 32 | 33 | -------------------------------------------------------------------------------- /CoreAnimation.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1D3623260D0F684500981E51 /* CoreAnimationAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* CoreAnimationAppDelegate.m */; }; 11 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 12 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 13 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 14 | 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */; }; 15 | 28C286E10D94DF7D0034E888 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28C286E00D94DF7D0034E888 /* RootViewController.m */; }; 16 | C4219A4C1325C70900FB5EA0 /* ReflectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C4219A4B1325C70900FB5EA0 /* ReflectionViewController.m */; }; 17 | C4219BE71325D98000FB5EA0 /* FlipViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C4219BE61325D98000FB5EA0 /* FlipViewController.m */; }; 18 | C423AA4C1325414100B2A34D /* StickyNotesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C423AA4B1325414100B2A34D /* StickyNotesViewController.m */; }; 19 | C423AA52132543A300B2A34D /* NoteView.m in Sources */ = {isa = PBXBuildFile; fileRef = C423AA51132543A300B2A34D /* NoteView.m */; }; 20 | C4334BB813248BE80023A4EA /* NSAViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C4334BB713248BE80023A4EA /* NSAViewController.m */; }; 21 | C43499D015ECDD3000AD9F40 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C43499CF15ECDD3000AD9F40 /* AVFoundation.framework */; }; 22 | C43499D215ECDD9600AD9F40 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C43499D115ECDD9500AD9F40 /* CoreMedia.framework */; }; 23 | C43648F71323902200107F88 /* ImplicitAnimationsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C43648F01323902200107F88 /* ImplicitAnimationsViewController.m */; }; 24 | C436495F1323954E00107F88 /* BatmanViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C436495A1323954E00107F88 /* BatmanViewController.m */; }; 25 | C43649601323954E00107F88 /* PacmanViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C436495C1323954E00107F88 /* PacmanViewController.m */; }; 26 | C43649611323954E00107F88 /* TachometerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C436495E1323954E00107F88 /* TachometerViewController.m */; }; 27 | C448C241168F861D00964E55 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C448C240168F861D00964E55 /* Default-568h@2x.png */; }; 28 | C456E7DC1328A45700E7E245 /* SublayerTransformViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C456E7DB1328A45700E7E245 /* SublayerTransformViewController.m */; }; 29 | C4573C6F17E9873600A338E0 /* obama.png in Resources */ = {isa = PBXBuildFile; fileRef = C4573C6E17E9873600A338E0 /* obama.png */; }; 30 | C4573C8017E98E9C00A338E0 /* pin.png in Resources */ = {isa = PBXBuildFile; fileRef = C4573C7C17E98E9C00A338E0 /* pin.png */; }; 31 | C4573C8117E98E9C00A338E0 /* pin@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C4573C7D17E98E9C00A338E0 /* pin@2x.png */; }; 32 | C4573C8217E98E9C00A338E0 /* tach.png in Resources */ = {isa = PBXBuildFile; fileRef = C4573C7E17E98E9C00A338E0 /* tach.png */; }; 33 | C4573C8317E98E9C00A338E0 /* tach@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C4573C7F17E98E9C00A338E0 /* tach@2x.png */; }; 34 | C4573C8A17E991D100A338E0 /* batman.png in Resources */ = {isa = PBXBuildFile; fileRef = C4573C8617E991D100A338E0 /* batman.png */; }; 35 | C4573C8B17E991D100A338E0 /* batman@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C4573C8717E991D100A338E0 /* batman@2x.png */; }; 36 | C4573C8E17E992BE00A338E0 /* BatmanButton.png in Resources */ = {isa = PBXBuildFile; fileRef = C4573C8C17E992BE00A338E0 /* BatmanButton.png */; }; 37 | C4573C8F17E992BE00A338E0 /* BatmanButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C4573C8D17E992BE00A338E0 /* BatmanButton@2x.png */; }; 38 | C462EEE0132576FD00D0F181 /* AVPlayerLayerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C462EEDF132576FD00D0F181 /* AVPlayerLayerViewController.m */; }; 39 | C4885B241324B57200E9CAD2 /* SimpleViewPropertyAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = C4885B231324B57200E9CAD2 /* SimpleViewPropertyAnimation.m */; }; 40 | C4888927132BFF470097A44E /* engine.caf in Resources */ = {isa = PBXBuildFile; fileRef = C4888907132BFF470097A44E /* engine.caf */; }; 41 | C4888928132BFF470097A44E /* arrow-down.png in Resources */ = {isa = PBXBuildFile; fileRef = C4888909132BFF470097A44E /* arrow-down.png */; }; 42 | C4888929132BFF470097A44E /* arrow-left.png in Resources */ = {isa = PBXBuildFile; fileRef = C488890A132BFF470097A44E /* arrow-left.png */; }; 43 | C488892A132BFF470097A44E /* arrow-right.png in Resources */ = {isa = PBXBuildFile; fileRef = C488890B132BFF470097A44E /* arrow-right.png */; }; 44 | C488892B132BFF470097A44E /* arrow-up.png in Resources */ = {isa = PBXBuildFile; fileRef = C488890C132BFF470097A44E /* arrow-up.png */; }; 45 | C488892C132BFF470097A44E /* backView.png in Resources */ = {isa = PBXBuildFile; fileRef = C488890D132BFF470097A44E /* backView.png */; }; 46 | C488892F132BFF470097A44E /* BobMcCune.png in Resources */ = {isa = PBXBuildFile; fileRef = C4888910132BFF470097A44E /* BobMcCune.png */; }; 47 | C4888930132BFF470097A44E /* caLogo.png in Resources */ = {isa = PBXBuildFile; fileRef = C4888911132BFF470097A44E /* caLogo.png */; }; 48 | C4888932132BFF470097A44E /* corkboard.png in Resources */ = {isa = PBXBuildFile; fileRef = C4888913132BFF470097A44E /* corkboard.png */; }; 49 | C4888933132BFF470097A44E /* heart.png in Resources */ = {isa = PBXBuildFile; fileRef = C4888914132BFF470097A44E /* heart.png */; }; 50 | C4888935132BFF470097A44E /* mountains.png in Resources */ = {isa = PBXBuildFile; fileRef = C4888916132BFF470097A44E /* mountains.png */; }; 51 | C4888936132BFF470097A44E /* new_note_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = C4888917132BFF470097A44E /* new_note_icon.png */; }; 52 | C4888937132BFF470097A44E /* pattern.png in Resources */ = {isa = PBXBuildFile; fileRef = C4888918132BFF470097A44E /* pattern.png */; }; 53 | C488893B132BFF470097A44E /* cyborg.m4v in Resources */ = {isa = PBXBuildFile; fileRef = C488891D132BFF470097A44E /* cyborg.m4v */; }; 54 | C488893C132BFF470097A44E /* CoreAnimationView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C488891F132BFF470097A44E /* CoreAnimationView.xib */; }; 55 | C488893D132BFF470097A44E /* LayerView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C4888920132BFF470097A44E /* LayerView.xib */; }; 56 | C488893E132BFF470097A44E /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = C4888921132BFF470097A44E /* MainWindow.xib */; }; 57 | C4888940132BFF470097A44E /* RootViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C4888923132BFF470097A44E /* RootViewController.xib */; }; 58 | C4888942132BFF470097A44E /* BatmanView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C4888925132BFF470097A44E /* BatmanView.xib */; }; 59 | C488894C132C07030097A44E /* CALayer+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = C488894B132C07030097A44E /* CALayer+Additions.m */; }; 60 | C4C6AFD41327146E005AB613 /* PulseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C4C6AFD31327146E005AB613 /* PulseViewController.m */; }; 61 | C4C6B05813274C8E005AB613 /* MakeItStickViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C4C6B05713274C8E005AB613 /* MakeItStickViewController.m */; }; 62 | C4DDB1A41320BAB3005E4D71 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4DDB1A31320BAB3005E4D71 /* QuartzCore.framework */; }; 63 | /* End PBXBuildFile section */ 64 | 65 | /* Begin PBXFileReference section */ 66 | 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 67 | 1D3623240D0F684500981E51 /* CoreAnimationAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreAnimationAppDelegate.h; sourceTree = ""; }; 68 | 1D3623250D0F684500981E51 /* CoreAnimationAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreAnimationAppDelegate.m; sourceTree = ""; }; 69 | 1D6058910D05DD3D006BFB54 /* CA Demos.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "CA Demos.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 70 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 71 | 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 72 | 28A0AAE50D9B0CCF005BE974 /* CoreAnimation_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreAnimation_Prefix.pch; sourceTree = ""; }; 73 | 28C286DF0D94DF7D0034E888 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; }; 74 | 28C286E00D94DF7D0034E888 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = ""; }; 75 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 76 | 8D1107310486CEB800E47090 /* CoreAnimation-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "CoreAnimation-Info.plist"; path = "../CoreAnimation-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; 77 | C4219A4A1325C70900FB5EA0 /* ReflectionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReflectionViewController.h; sourceTree = ""; }; 78 | C4219A4B1325C70900FB5EA0 /* ReflectionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReflectionViewController.m; sourceTree = ""; }; 79 | C4219BE51325D98000FB5EA0 /* FlipViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlipViewController.h; sourceTree = ""; }; 80 | C4219BE61325D98000FB5EA0 /* FlipViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FlipViewController.m; sourceTree = ""; }; 81 | C423AA4A1325414100B2A34D /* StickyNotesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StickyNotesViewController.h; sourceTree = ""; }; 82 | C423AA4B1325414100B2A34D /* StickyNotesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StickyNotesViewController.m; sourceTree = ""; }; 83 | C423AA50132543A300B2A34D /* NoteView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoteView.h; sourceTree = ""; }; 84 | C423AA51132543A300B2A34D /* NoteView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NoteView.m; sourceTree = ""; }; 85 | C4334BB613248BE80023A4EA /* NSAViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSAViewController.h; sourceTree = ""; }; 86 | C4334BB713248BE80023A4EA /* NSAViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSAViewController.m; sourceTree = ""; }; 87 | C43499CF15ECDD3000AD9F40 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 88 | C43499D115ECDD9500AD9F40 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; 89 | C43648EF1323902200107F88 /* ImplicitAnimationsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImplicitAnimationsViewController.h; sourceTree = ""; }; 90 | C43648F01323902200107F88 /* ImplicitAnimationsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImplicitAnimationsViewController.m; sourceTree = ""; }; 91 | C43649591323954E00107F88 /* BatmanViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BatmanViewController.h; sourceTree = ""; }; 92 | C436495A1323954E00107F88 /* BatmanViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BatmanViewController.m; sourceTree = ""; }; 93 | C436495B1323954E00107F88 /* PacmanViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PacmanViewController.h; sourceTree = ""; }; 94 | C436495C1323954E00107F88 /* PacmanViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PacmanViewController.m; sourceTree = ""; }; 95 | C436495D1323954E00107F88 /* TachometerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TachometerViewController.h; sourceTree = ""; }; 96 | C436495E1323954E00107F88 /* TachometerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TachometerViewController.m; sourceTree = ""; }; 97 | C448C240168F861D00964E55 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 98 | C456E7DA1328A45700E7E245 /* SublayerTransformViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SublayerTransformViewController.h; sourceTree = ""; }; 99 | C456E7DB1328A45700E7E245 /* SublayerTransformViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SublayerTransformViewController.m; sourceTree = ""; }; 100 | C4573C6E17E9873600A338E0 /* obama.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = obama.png; sourceTree = ""; }; 101 | C4573C7C17E98E9C00A338E0 /* pin.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pin.png; sourceTree = ""; }; 102 | C4573C7D17E98E9C00A338E0 /* pin@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pin@2x.png"; sourceTree = ""; }; 103 | C4573C7E17E98E9C00A338E0 /* tach.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tach.png; sourceTree = ""; }; 104 | C4573C7F17E98E9C00A338E0 /* tach@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tach@2x.png"; sourceTree = ""; }; 105 | C4573C8617E991D100A338E0 /* batman.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = batman.png; sourceTree = ""; }; 106 | C4573C8717E991D100A338E0 /* batman@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "batman@2x.png"; sourceTree = ""; }; 107 | C4573C8C17E992BE00A338E0 /* BatmanButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = BatmanButton.png; sourceTree = ""; }; 108 | C4573C8D17E992BE00A338E0 /* BatmanButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "BatmanButton@2x.png"; sourceTree = ""; }; 109 | C462EEDE132576FD00D0F181 /* AVPlayerLayerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVPlayerLayerViewController.h; sourceTree = ""; }; 110 | C462EEDF132576FD00D0F181 /* AVPlayerLayerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AVPlayerLayerViewController.m; sourceTree = ""; }; 111 | C4885B221324B57200E9CAD2 /* SimpleViewPropertyAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleViewPropertyAnimation.h; sourceTree = ""; }; 112 | C4885B231324B57200E9CAD2 /* SimpleViewPropertyAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SimpleViewPropertyAnimation.m; sourceTree = ""; }; 113 | C4888907132BFF470097A44E /* engine.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = engine.caf; sourceTree = ""; }; 114 | C4888909132BFF470097A44E /* arrow-down.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "arrow-down.png"; sourceTree = ""; }; 115 | C488890A132BFF470097A44E /* arrow-left.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "arrow-left.png"; sourceTree = ""; }; 116 | C488890B132BFF470097A44E /* arrow-right.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "arrow-right.png"; sourceTree = ""; }; 117 | C488890C132BFF470097A44E /* arrow-up.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "arrow-up.png"; sourceTree = ""; }; 118 | C488890D132BFF470097A44E /* backView.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = backView.png; sourceTree = ""; }; 119 | C4888910132BFF470097A44E /* BobMcCune.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = BobMcCune.png; sourceTree = ""; }; 120 | C4888911132BFF470097A44E /* caLogo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = caLogo.png; sourceTree = ""; }; 121 | C4888913132BFF470097A44E /* corkboard.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = corkboard.png; sourceTree = ""; }; 122 | C4888914132BFF470097A44E /* heart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = heart.png; sourceTree = ""; }; 123 | C4888916132BFF470097A44E /* mountains.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = mountains.png; sourceTree = ""; }; 124 | C4888917132BFF470097A44E /* new_note_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = new_note_icon.png; sourceTree = ""; }; 125 | C4888918132BFF470097A44E /* pattern.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pattern.png; sourceTree = ""; }; 126 | C488891D132BFF470097A44E /* cyborg.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = cyborg.m4v; sourceTree = ""; }; 127 | C488891F132BFF470097A44E /* CoreAnimationView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CoreAnimationView.xib; sourceTree = ""; }; 128 | C4888920132BFF470097A44E /* LayerView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LayerView.xib; sourceTree = ""; }; 129 | C4888921132BFF470097A44E /* MainWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; 130 | C4888923132BFF470097A44E /* RootViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RootViewController.xib; sourceTree = ""; }; 131 | C4888925132BFF470097A44E /* BatmanView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BatmanView.xib; sourceTree = ""; }; 132 | C488894A132C07030097A44E /* CALayer+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CALayer+Additions.h"; sourceTree = ""; }; 133 | C488894B132C07030097A44E /* CALayer+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CALayer+Additions.m"; sourceTree = ""; }; 134 | C4C6AFD21327146E005AB613 /* PulseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PulseViewController.h; sourceTree = ""; }; 135 | C4C6AFD31327146E005AB613 /* PulseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PulseViewController.m; sourceTree = ""; }; 136 | C4C6B05613274C8E005AB613 /* MakeItStickViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MakeItStickViewController.h; sourceTree = ""; }; 137 | C4C6B05713274C8E005AB613 /* MakeItStickViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MakeItStickViewController.m; sourceTree = ""; }; 138 | C4DDB1A31320BAB3005E4D71 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 139 | /* End PBXFileReference section */ 140 | 141 | /* Begin PBXFrameworksBuildPhase section */ 142 | 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { 143 | isa = PBXFrameworksBuildPhase; 144 | buildActionMask = 2147483647; 145 | files = ( 146 | C43499D015ECDD3000AD9F40 /* AVFoundation.framework in Frameworks */, 147 | C43499D215ECDD9600AD9F40 /* CoreMedia.framework in Frameworks */, 148 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 149 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 150 | 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */, 151 | C4DDB1A41320BAB3005E4D71 /* QuartzCore.framework in Frameworks */, 152 | ); 153 | runOnlyForDeploymentPostprocessing = 0; 154 | }; 155 | /* End PBXFrameworksBuildPhase section */ 156 | 157 | /* Begin PBXGroup section */ 158 | 080E96DDFE201D6D7F000001 /* Classes */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | C43648E81323902200107F88 /* CoreAnimation */, 162 | C43648F41323902200107F88 /* UIKitAnimation */, 163 | 1D3623240D0F684500981E51 /* CoreAnimationAppDelegate.h */, 164 | 1D3623250D0F684500981E51 /* CoreAnimationAppDelegate.m */, 165 | 28C286DF0D94DF7D0034E888 /* RootViewController.h */, 166 | 28C286E00D94DF7D0034E888 /* RootViewController.m */, 167 | ); 168 | path = Classes; 169 | sourceTree = ""; 170 | }; 171 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | 1D6058910D05DD3D006BFB54 /* CA Demos.app */, 175 | ); 176 | name = Products; 177 | sourceTree = ""; 178 | }; 179 | 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | 080E96DDFE201D6D7F000001 /* Classes */, 183 | C4888905132BFF470097A44E /* Resources */, 184 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 185 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 186 | 19C28FACFE9D520D11CA2CBB /* Products */, 187 | ); 188 | name = CustomTemplate; 189 | sourceTree = ""; 190 | }; 191 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 192 | isa = PBXGroup; 193 | children = ( 194 | 28A0AAE50D9B0CCF005BE974 /* CoreAnimation_Prefix.pch */, 195 | 29B97316FDCFA39411CA2CEA /* main.m */, 196 | ); 197 | name = "Other Sources"; 198 | sourceTree = ""; 199 | }; 200 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 201 | isa = PBXGroup; 202 | children = ( 203 | C43499D115ECDD9500AD9F40 /* CoreMedia.framework */, 204 | C43499CF15ECDD3000AD9F40 /* AVFoundation.framework */, 205 | C4DDB1A31320BAB3005E4D71 /* QuartzCore.framework */, 206 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 207 | 1D30AB110D05D00D00671497 /* Foundation.framework */, 208 | 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */, 209 | ); 210 | name = Frameworks; 211 | sourceTree = ""; 212 | }; 213 | C43648E81323902200107F88 /* CoreAnimation */ = { 214 | isa = PBXGroup; 215 | children = ( 216 | C462EEDE132576FD00D0F181 /* AVPlayerLayerViewController.h */, 217 | C462EEDF132576FD00D0F181 /* AVPlayerLayerViewController.m */, 218 | C43649591323954E00107F88 /* BatmanViewController.h */, 219 | C436495A1323954E00107F88 /* BatmanViewController.m */, 220 | C488894A132C07030097A44E /* CALayer+Additions.h */, 221 | C488894B132C07030097A44E /* CALayer+Additions.m */, 222 | C4334BB613248BE80023A4EA /* NSAViewController.h */, 223 | C4334BB713248BE80023A4EA /* NSAViewController.m */, 224 | C43648EF1323902200107F88 /* ImplicitAnimationsViewController.h */, 225 | C43648F01323902200107F88 /* ImplicitAnimationsViewController.m */, 226 | C4C6B05613274C8E005AB613 /* MakeItStickViewController.h */, 227 | C4C6B05713274C8E005AB613 /* MakeItStickViewController.m */, 228 | C436495B1323954E00107F88 /* PacmanViewController.h */, 229 | C436495C1323954E00107F88 /* PacmanViewController.m */, 230 | C4C6AFD21327146E005AB613 /* PulseViewController.h */, 231 | C4C6AFD31327146E005AB613 /* PulseViewController.m */, 232 | C4219A4A1325C70900FB5EA0 /* ReflectionViewController.h */, 233 | C4219A4B1325C70900FB5EA0 /* ReflectionViewController.m */, 234 | C456E7DA1328A45700E7E245 /* SublayerTransformViewController.h */, 235 | C456E7DB1328A45700E7E245 /* SublayerTransformViewController.m */, 236 | C436495D1323954E00107F88 /* TachometerViewController.h */, 237 | C436495E1323954E00107F88 /* TachometerViewController.m */, 238 | ); 239 | path = CoreAnimation; 240 | sourceTree = ""; 241 | }; 242 | C43648F41323902200107F88 /* UIKitAnimation */ = { 243 | isa = PBXGroup; 244 | children = ( 245 | C4885B221324B57200E9CAD2 /* SimpleViewPropertyAnimation.h */, 246 | C4885B231324B57200E9CAD2 /* SimpleViewPropertyAnimation.m */, 247 | C423AA4A1325414100B2A34D /* StickyNotesViewController.h */, 248 | C423AA4B1325414100B2A34D /* StickyNotesViewController.m */, 249 | C423AA50132543A300B2A34D /* NoteView.h */, 250 | C423AA51132543A300B2A34D /* NoteView.m */, 251 | C4219BE51325D98000FB5EA0 /* FlipViewController.h */, 252 | C4219BE61325D98000FB5EA0 /* FlipViewController.m */, 253 | ); 254 | path = UIKitAnimation; 255 | sourceTree = ""; 256 | }; 257 | C4888905132BFF470097A44E /* Resources */ = { 258 | isa = PBXGroup; 259 | children = ( 260 | C4888906132BFF470097A44E /* Audio */, 261 | C4888908132BFF470097A44E /* Images */, 262 | C488891C132BFF470097A44E /* Videos */, 263 | C488891E132BFF470097A44E /* XIBs */, 264 | 8D1107310486CEB800E47090 /* CoreAnimation-Info.plist */, 265 | ); 266 | path = Resources; 267 | sourceTree = ""; 268 | }; 269 | C4888906132BFF470097A44E /* Audio */ = { 270 | isa = PBXGroup; 271 | children = ( 272 | C4888907132BFF470097A44E /* engine.caf */, 273 | ); 274 | path = Audio; 275 | sourceTree = ""; 276 | }; 277 | C4888908132BFF470097A44E /* Images */ = { 278 | isa = PBXGroup; 279 | children = ( 280 | C4573C8C17E992BE00A338E0 /* BatmanButton.png */, 281 | C4573C8D17E992BE00A338E0 /* BatmanButton@2x.png */, 282 | C4573C8617E991D100A338E0 /* batman.png */, 283 | C4573C8717E991D100A338E0 /* batman@2x.png */, 284 | C4573C7C17E98E9C00A338E0 /* pin.png */, 285 | C4573C7D17E98E9C00A338E0 /* pin@2x.png */, 286 | C4573C7E17E98E9C00A338E0 /* tach.png */, 287 | C4573C7F17E98E9C00A338E0 /* tach@2x.png */, 288 | C4888909132BFF470097A44E /* arrow-down.png */, 289 | C488890A132BFF470097A44E /* arrow-left.png */, 290 | C488890B132BFF470097A44E /* arrow-right.png */, 291 | C488890C132BFF470097A44E /* arrow-up.png */, 292 | C488890D132BFF470097A44E /* backView.png */, 293 | C4888910132BFF470097A44E /* BobMcCune.png */, 294 | C4888911132BFF470097A44E /* caLogo.png */, 295 | C4888913132BFF470097A44E /* corkboard.png */, 296 | C448C240168F861D00964E55 /* Default-568h@2x.png */, 297 | C4888914132BFF470097A44E /* heart.png */, 298 | C4888916132BFF470097A44E /* mountains.png */, 299 | C4888917132BFF470097A44E /* new_note_icon.png */, 300 | C4573C6E17E9873600A338E0 /* obama.png */, 301 | C4888918132BFF470097A44E /* pattern.png */, 302 | ); 303 | path = Images; 304 | sourceTree = ""; 305 | }; 306 | C488891C132BFF470097A44E /* Videos */ = { 307 | isa = PBXGroup; 308 | children = ( 309 | C488891D132BFF470097A44E /* cyborg.m4v */, 310 | ); 311 | path = Videos; 312 | sourceTree = ""; 313 | }; 314 | C488891E132BFF470097A44E /* XIBs */ = { 315 | isa = PBXGroup; 316 | children = ( 317 | C488891F132BFF470097A44E /* CoreAnimationView.xib */, 318 | C4888920132BFF470097A44E /* LayerView.xib */, 319 | C4888921132BFF470097A44E /* MainWindow.xib */, 320 | C4888923132BFF470097A44E /* RootViewController.xib */, 321 | C4888925132BFF470097A44E /* BatmanView.xib */, 322 | ); 323 | path = XIBs; 324 | sourceTree = ""; 325 | }; 326 | /* End PBXGroup section */ 327 | 328 | /* Begin PBXNativeTarget section */ 329 | 1D6058900D05DD3D006BFB54 /* CoreAnimation */ = { 330 | isa = PBXNativeTarget; 331 | buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "CoreAnimation" */; 332 | buildPhases = ( 333 | 1D60588D0D05DD3D006BFB54 /* Resources */, 334 | 1D60588E0D05DD3D006BFB54 /* Sources */, 335 | 1D60588F0D05DD3D006BFB54 /* Frameworks */, 336 | ); 337 | buildRules = ( 338 | ); 339 | dependencies = ( 340 | ); 341 | name = CoreAnimation; 342 | productName = CoreAnimation; 343 | productReference = 1D6058910D05DD3D006BFB54 /* CA Demos.app */; 344 | productType = "com.apple.product-type.application"; 345 | }; 346 | /* End PBXNativeTarget section */ 347 | 348 | /* Begin PBXProject section */ 349 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 350 | isa = PBXProject; 351 | attributes = { 352 | LastUpgradeCheck = 0500; 353 | }; 354 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CoreAnimation" */; 355 | compatibilityVersion = "Xcode 3.2"; 356 | developmentRegion = English; 357 | hasScannedForEncodings = 1; 358 | knownRegions = ( 359 | English, 360 | Japanese, 361 | French, 362 | German, 363 | en, 364 | ); 365 | mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; 366 | projectDirPath = ""; 367 | projectRoot = ""; 368 | targets = ( 369 | 1D6058900D05DD3D006BFB54 /* CoreAnimation */, 370 | ); 371 | }; 372 | /* End PBXProject section */ 373 | 374 | /* Begin PBXResourcesBuildPhase section */ 375 | 1D60588D0D05DD3D006BFB54 /* Resources */ = { 376 | isa = PBXResourcesBuildPhase; 377 | buildActionMask = 2147483647; 378 | files = ( 379 | C4888927132BFF470097A44E /* engine.caf in Resources */, 380 | C4888928132BFF470097A44E /* arrow-down.png in Resources */, 381 | C4888929132BFF470097A44E /* arrow-left.png in Resources */, 382 | C4573C8E17E992BE00A338E0 /* BatmanButton.png in Resources */, 383 | C488892A132BFF470097A44E /* arrow-right.png in Resources */, 384 | C488892B132BFF470097A44E /* arrow-up.png in Resources */, 385 | C488892C132BFF470097A44E /* backView.png in Resources */, 386 | C4573C6F17E9873600A338E0 /* obama.png in Resources */, 387 | C488892F132BFF470097A44E /* BobMcCune.png in Resources */, 388 | C4888930132BFF470097A44E /* caLogo.png in Resources */, 389 | C4573C8A17E991D100A338E0 /* batman.png in Resources */, 390 | C4573C8217E98E9C00A338E0 /* tach.png in Resources */, 391 | C4573C8117E98E9C00A338E0 /* pin@2x.png in Resources */, 392 | C4888932132BFF470097A44E /* corkboard.png in Resources */, 393 | C4888933132BFF470097A44E /* heart.png in Resources */, 394 | C4888935132BFF470097A44E /* mountains.png in Resources */, 395 | C4573C8317E98E9C00A338E0 /* tach@2x.png in Resources */, 396 | C4573C8B17E991D100A338E0 /* batman@2x.png in Resources */, 397 | C4888936132BFF470097A44E /* new_note_icon.png in Resources */, 398 | C4888937132BFF470097A44E /* pattern.png in Resources */, 399 | C4573C8F17E992BE00A338E0 /* BatmanButton@2x.png in Resources */, 400 | C488893B132BFF470097A44E /* cyborg.m4v in Resources */, 401 | C488893C132BFF470097A44E /* CoreAnimationView.xib in Resources */, 402 | C488893D132BFF470097A44E /* LayerView.xib in Resources */, 403 | C488893E132BFF470097A44E /* MainWindow.xib in Resources */, 404 | C4888940132BFF470097A44E /* RootViewController.xib in Resources */, 405 | C4888942132BFF470097A44E /* BatmanView.xib in Resources */, 406 | C448C241168F861D00964E55 /* Default-568h@2x.png in Resources */, 407 | C4573C8017E98E9C00A338E0 /* pin.png in Resources */, 408 | ); 409 | runOnlyForDeploymentPostprocessing = 0; 410 | }; 411 | /* End PBXResourcesBuildPhase section */ 412 | 413 | /* Begin PBXSourcesBuildPhase section */ 414 | 1D60588E0D05DD3D006BFB54 /* Sources */ = { 415 | isa = PBXSourcesBuildPhase; 416 | buildActionMask = 2147483647; 417 | files = ( 418 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 419 | 1D3623260D0F684500981E51 /* CoreAnimationAppDelegate.m in Sources */, 420 | 28C286E10D94DF7D0034E888 /* RootViewController.m in Sources */, 421 | C43648F71323902200107F88 /* ImplicitAnimationsViewController.m in Sources */, 422 | C436495F1323954E00107F88 /* BatmanViewController.m in Sources */, 423 | C43649601323954E00107F88 /* PacmanViewController.m in Sources */, 424 | C43649611323954E00107F88 /* TachometerViewController.m in Sources */, 425 | C4334BB813248BE80023A4EA /* NSAViewController.m in Sources */, 426 | C4885B241324B57200E9CAD2 /* SimpleViewPropertyAnimation.m in Sources */, 427 | C423AA4C1325414100B2A34D /* StickyNotesViewController.m in Sources */, 428 | C423AA52132543A300B2A34D /* NoteView.m in Sources */, 429 | C462EEE0132576FD00D0F181 /* AVPlayerLayerViewController.m in Sources */, 430 | C4219A4C1325C70900FB5EA0 /* ReflectionViewController.m in Sources */, 431 | C4219BE71325D98000FB5EA0 /* FlipViewController.m in Sources */, 432 | C4C6AFD41327146E005AB613 /* PulseViewController.m in Sources */, 433 | C4C6B05813274C8E005AB613 /* MakeItStickViewController.m in Sources */, 434 | C456E7DC1328A45700E7E245 /* SublayerTransformViewController.m in Sources */, 435 | C488894C132C07030097A44E /* CALayer+Additions.m in Sources */, 436 | ); 437 | runOnlyForDeploymentPostprocessing = 0; 438 | }; 439 | /* End PBXSourcesBuildPhase section */ 440 | 441 | /* Begin XCBuildConfiguration section */ 442 | 1D6058940D05DD3E006BFB54 /* Debug */ = { 443 | isa = XCBuildConfiguration; 444 | buildSettings = { 445 | ALWAYS_SEARCH_USER_PATHS = NO; 446 | CLANG_ENABLE_OBJC_ARC = YES; 447 | COPY_PHASE_STRIP = NO; 448 | GCC_DYNAMIC_NO_PIC = NO; 449 | GCC_OPTIMIZATION_LEVEL = 0; 450 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 451 | GCC_PREFIX_HEADER = CoreAnimation_Prefix.pch; 452 | GCC_VERSION = ""; 453 | INFOPLIST_FILE = "CoreAnimation-Info.plist"; 454 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 455 | PRODUCT_NAME = "CA Demos"; 456 | }; 457 | name = Debug; 458 | }; 459 | 1D6058950D05DD3E006BFB54 /* Release */ = { 460 | isa = XCBuildConfiguration; 461 | buildSettings = { 462 | ALWAYS_SEARCH_USER_PATHS = NO; 463 | CLANG_ENABLE_OBJC_ARC = YES; 464 | COPY_PHASE_STRIP = YES; 465 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 466 | GCC_PREFIX_HEADER = CoreAnimation_Prefix.pch; 467 | GCC_VERSION = ""; 468 | INFOPLIST_FILE = "CoreAnimation-Info.plist"; 469 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 470 | PRODUCT_NAME = "CA Demos"; 471 | VALIDATE_PRODUCT = YES; 472 | }; 473 | name = Release; 474 | }; 475 | C01FCF4F08A954540054247B /* Debug */ = { 476 | isa = XCBuildConfiguration; 477 | buildSettings = { 478 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 479 | GCC_C_LANGUAGE_STANDARD = c99; 480 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 481 | GCC_WARN_UNUSED_VARIABLE = YES; 482 | ONLY_ACTIVE_ARCH = YES; 483 | PRODUCT_NAME = "CA Demos"; 484 | SDKROOT = iphoneos; 485 | }; 486 | name = Debug; 487 | }; 488 | C01FCF5008A954540054247B /* Release */ = { 489 | isa = XCBuildConfiguration; 490 | buildSettings = { 491 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 492 | GCC_C_LANGUAGE_STANDARD = c99; 493 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 494 | GCC_WARN_UNUSED_VARIABLE = YES; 495 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 496 | PRODUCT_NAME = "CA Demos"; 497 | SDKROOT = iphoneos; 498 | }; 499 | name = Release; 500 | }; 501 | /* End XCBuildConfiguration section */ 502 | 503 | /* Begin XCConfigurationList section */ 504 | 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "CoreAnimation" */ = { 505 | isa = XCConfigurationList; 506 | buildConfigurations = ( 507 | 1D6058940D05DD3E006BFB54 /* Debug */, 508 | 1D6058950D05DD3E006BFB54 /* Release */, 509 | ); 510 | defaultConfigurationIsVisible = 0; 511 | defaultConfigurationName = Release; 512 | }; 513 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CoreAnimation" */ = { 514 | isa = XCConfigurationList; 515 | buildConfigurations = ( 516 | C01FCF4F08A954540054247B /* Debug */, 517 | C01FCF5008A954540054247B /* Release */, 518 | ); 519 | defaultConfigurationIsVisible = 0; 520 | defaultConfigurationName = Release; 521 | }; 522 | /* End XCConfigurationList section */ 523 | }; 524 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 525 | } 526 | -------------------------------------------------------------------------------- /CoreAnimation.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CoreAnimation.xcodeproj/project.xcworkspace/xcshareddata/CoreAnimation.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 41624C74-CB8B-40E5-93F7-91D0349572D7 9 | IDESourceControlProjectName 10 | CoreAnimation 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | F5E9AE9A-C540-42E1-AFBD-08F1A598856B 14 | ssh://github.com/tapharmonic/Core-Animation-Demos.git 15 | 16 | IDESourceControlProjectPath 17 | CoreAnimation.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | F5E9AE9A-C540-42E1-AFBD-08F1A598856B 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/tapharmonic/Core-Animation-Demos.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | F5E9AE9A-C540-42E1-AFBD-08F1A598856B 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | F5E9AE9A-C540-42E1-AFBD-08F1A598856B 36 | IDESourceControlWCCName 37 | Core-Animation-Demos 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /CoreAnimation_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CoreAnimation' target in the 'CoreAnimation' project 3 | // 4 | #import 5 | 6 | #ifndef __IPHONE_3_0 7 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 8 | #endif 9 | 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #import 15 | #endif 16 | 17 | #define DEGREES_TO_RADIANS(d) (d * M_PI / 180) 18 | 19 | static CGPoint midPoint(CGRect r) { 20 | return CGPointMake(CGRectGetMidX(r), CGRectGetMidY(r)); 21 | } 22 | 23 | static CATransform3D CATransform3DMakePerspective(CGFloat z) { 24 | CATransform3D t = CATransform3DIdentity; 25 | t.m34 = - 1.0 / z; 26 | return t; 27 | } 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Demo project for the **Core Animation** presentation I gave to the March 2011 [Minnesota CocoaHeads](http://www.cocoaheadsmn.org/) group meeting. -------------------------------------------------------------------------------- /Resources/Audio/engine.caf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Audio/engine.caf -------------------------------------------------------------------------------- /Resources/Images/BatmanButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/BatmanButton.png -------------------------------------------------------------------------------- /Resources/Images/BatmanButton@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/BatmanButton@2x.png -------------------------------------------------------------------------------- /Resources/Images/BobMcCune.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/BobMcCune.png -------------------------------------------------------------------------------- /Resources/Images/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/Default-568h@2x.png -------------------------------------------------------------------------------- /Resources/Images/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/arrow-down.png -------------------------------------------------------------------------------- /Resources/Images/arrow-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/arrow-left.png -------------------------------------------------------------------------------- /Resources/Images/arrow-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/arrow-right.png -------------------------------------------------------------------------------- /Resources/Images/arrow-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/arrow-up.png -------------------------------------------------------------------------------- /Resources/Images/backView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/backView.png -------------------------------------------------------------------------------- /Resources/Images/batman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/batman.png -------------------------------------------------------------------------------- /Resources/Images/batman@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/batman@2x.png -------------------------------------------------------------------------------- /Resources/Images/caLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/caLogo.png -------------------------------------------------------------------------------- /Resources/Images/corkboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/corkboard.png -------------------------------------------------------------------------------- /Resources/Images/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/heart.png -------------------------------------------------------------------------------- /Resources/Images/mountains.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/mountains.png -------------------------------------------------------------------------------- /Resources/Images/new_note_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/new_note_icon.png -------------------------------------------------------------------------------- /Resources/Images/obama.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/obama.png -------------------------------------------------------------------------------- /Resources/Images/pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/pattern.png -------------------------------------------------------------------------------- /Resources/Images/pin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/pin.png -------------------------------------------------------------------------------- /Resources/Images/pin@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/pin@2x.png -------------------------------------------------------------------------------- /Resources/Images/tach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/tach.png -------------------------------------------------------------------------------- /Resources/Images/tach@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Images/tach@2x.png -------------------------------------------------------------------------------- /Resources/Videos/cyborg.m4v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapharmonic/Core-Animation-Demos/77106cd117b1ca8ae5bed6f6f98c8beb09646d2f/Resources/Videos/cyborg.m4v -------------------------------------------------------------------------------- /Resources/XIBs/BatmanView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Resources/XIBs/CoreAnimationView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J567 6 | 823 7 | 1038.35 8 | 462.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 132 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | 42 | 274 43 | {320, 460} 44 | 45 | 46 | 3 47 | MQA 48 | 49 | 2 50 | 51 | 52 | 53 | IBCocoaTouchFramework 54 | 55 | 56 | 57 | 58 | YES 59 | 60 | 61 | view 62 | 63 | 64 | 65 | 3 66 | 67 | 68 | 69 | 70 | YES 71 | 72 | 0 73 | 74 | 75 | 76 | 77 | 78 | 1 79 | 80 | 81 | 82 | 83 | -1 84 | 85 | 86 | File's Owner 87 | 88 | 89 | -2 90 | 91 | 92 | 93 | 94 | 95 | 96 | YES 97 | 98 | YES 99 | -1.CustomClassName 100 | -2.CustomClassName 101 | 1.IBEditorWindowLastContentRect 102 | 1.IBPluginDependency 103 | 104 | 105 | YES 106 | CoreAnimationViewController 107 | UIResponder 108 | {{354, 412}, {320, 480}} 109 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 110 | 111 | 112 | 113 | YES 114 | 115 | 116 | YES 117 | 118 | 119 | 120 | 121 | YES 122 | 123 | 124 | YES 125 | 126 | 127 | 128 | 3 129 | 130 | 131 | 132 | YES 133 | 134 | CoreAnimationViewController 135 | UIViewController 136 | 137 | IBProjectSource 138 | Classes/CoreAnimationViewController.h 139 | 140 | 141 | 142 | 143 | YES 144 | 145 | NSObject 146 | 147 | IBFrameworkSource 148 | Foundation.framework/Headers/NSError.h 149 | 150 | 151 | 152 | NSObject 153 | 154 | IBFrameworkSource 155 | Foundation.framework/Headers/NSFileManager.h 156 | 157 | 158 | 159 | NSObject 160 | 161 | IBFrameworkSource 162 | Foundation.framework/Headers/NSKeyValueCoding.h 163 | 164 | 165 | 166 | NSObject 167 | 168 | IBFrameworkSource 169 | Foundation.framework/Headers/NSKeyValueObserving.h 170 | 171 | 172 | 173 | NSObject 174 | 175 | IBFrameworkSource 176 | Foundation.framework/Headers/NSKeyedArchiver.h 177 | 178 | 179 | 180 | NSObject 181 | 182 | IBFrameworkSource 183 | Foundation.framework/Headers/NSObject.h 184 | 185 | 186 | 187 | NSObject 188 | 189 | IBFrameworkSource 190 | Foundation.framework/Headers/NSRunLoop.h 191 | 192 | 193 | 194 | NSObject 195 | 196 | IBFrameworkSource 197 | Foundation.framework/Headers/NSThread.h 198 | 199 | 200 | 201 | NSObject 202 | 203 | IBFrameworkSource 204 | Foundation.framework/Headers/NSURL.h 205 | 206 | 207 | 208 | NSObject 209 | 210 | IBFrameworkSource 211 | Foundation.framework/Headers/NSURLConnection.h 212 | 213 | 214 | 215 | NSObject 216 | 217 | IBFrameworkSource 218 | QuartzCore.framework/Headers/CAAnimation.h 219 | 220 | 221 | 222 | NSObject 223 | 224 | IBFrameworkSource 225 | QuartzCore.framework/Headers/CALayer.h 226 | 227 | 228 | 229 | NSObject 230 | 231 | IBFrameworkSource 232 | UIKit.framework/Headers/UIAccessibility.h 233 | 234 | 235 | 236 | NSObject 237 | 238 | IBFrameworkSource 239 | UIKit.framework/Headers/UINibLoading.h 240 | 241 | 242 | 243 | NSObject 244 | 245 | IBFrameworkSource 246 | UIKit.framework/Headers/UIResponder.h 247 | 248 | 249 | 250 | UIResponder 251 | NSObject 252 | 253 | 254 | 255 | UISearchBar 256 | UIView 257 | 258 | IBFrameworkSource 259 | UIKit.framework/Headers/UISearchBar.h 260 | 261 | 262 | 263 | UISearchDisplayController 264 | NSObject 265 | 266 | IBFrameworkSource 267 | UIKit.framework/Headers/UISearchDisplayController.h 268 | 269 | 270 | 271 | UIView 272 | 273 | IBFrameworkSource 274 | UIKit.framework/Headers/UIPrintFormatter.h 275 | 276 | 277 | 278 | UIView 279 | 280 | IBFrameworkSource 281 | UIKit.framework/Headers/UITextField.h 282 | 283 | 284 | 285 | UIView 286 | UIResponder 287 | 288 | IBFrameworkSource 289 | UIKit.framework/Headers/UIView.h 290 | 291 | 292 | 293 | UIViewController 294 | 295 | IBFrameworkSource 296 | UIKit.framework/Headers/UINavigationController.h 297 | 298 | 299 | 300 | UIViewController 301 | 302 | IBFrameworkSource 303 | UIKit.framework/Headers/UIPopoverController.h 304 | 305 | 306 | 307 | UIViewController 308 | 309 | IBFrameworkSource 310 | UIKit.framework/Headers/UISplitViewController.h 311 | 312 | 313 | 314 | UIViewController 315 | 316 | IBFrameworkSource 317 | UIKit.framework/Headers/UITabBarController.h 318 | 319 | 320 | 321 | UIViewController 322 | UIResponder 323 | 324 | IBFrameworkSource 325 | UIKit.framework/Headers/UIViewController.h 326 | 327 | 328 | 329 | 330 | 0 331 | IBCocoaTouchFramework 332 | 333 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 334 | 335 | 336 | 337 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 338 | 339 | 340 | YES 341 | 342 | 3 343 | 132 344 | 345 | 346 | -------------------------------------------------------------------------------- /Resources/XIBs/LayerView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 36 | 47 | 58 | 69 | 80 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /Resources/XIBs/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1024 5 | 10D571 6 | 786 7 | 1038.29 8 | 460.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 112 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | IBCocoaTouchFramework 42 | 43 | 44 | 45 | 1316 46 | 47 | {320, 480} 48 | 49 | 1 50 | MSAxIDEAA 51 | 52 | NO 53 | NO 54 | 55 | IBCocoaTouchFramework 56 | YES 57 | 58 | 59 | 60 | 61 | 1 62 | 63 | IBCocoaTouchFramework 64 | NO 65 | 66 | 67 | 256 68 | {0, 0} 69 | NO 70 | YES 71 | YES 72 | IBCocoaTouchFramework 73 | 74 | 75 | YES 76 | 77 | 78 | 79 | IBCocoaTouchFramework 80 | 81 | 82 | RootViewController 83 | 84 | 85 | 1 86 | 87 | IBCocoaTouchFramework 88 | NO 89 | 90 | 91 | 92 | 93 | 94 | 95 | YES 96 | 97 | 98 | delegate 99 | 100 | 101 | 102 | 4 103 | 104 | 105 | 106 | window 107 | 108 | 109 | 110 | 5 111 | 112 | 113 | 114 | navigationController 115 | 116 | 117 | 118 | 15 119 | 120 | 121 | 122 | 123 | YES 124 | 125 | 0 126 | 127 | 128 | 129 | 130 | 131 | 2 132 | 133 | 134 | YES 135 | 136 | 137 | 138 | 139 | -1 140 | 141 | 142 | File's Owner 143 | 144 | 145 | 3 146 | 147 | 148 | 149 | 150 | -2 151 | 152 | 153 | 154 | 155 | 9 156 | 157 | 158 | YES 159 | 160 | 161 | 162 | 163 | 164 | 165 | 11 166 | 167 | 168 | 169 | 170 | 13 171 | 172 | 173 | YES 174 | 175 | 176 | 177 | 178 | 179 | 14 180 | 181 | 182 | 183 | 184 | 185 | 186 | YES 187 | 188 | YES 189 | -1.CustomClassName 190 | -2.CustomClassName 191 | 11.IBPluginDependency 192 | 13.CustomClassName 193 | 13.IBPluginDependency 194 | 2.IBAttributePlaceholdersKey 195 | 2.IBEditorWindowLastContentRect 196 | 2.IBPluginDependency 197 | 3.CustomClassName 198 | 3.IBPluginDependency 199 | 9.IBEditorWindowLastContentRect 200 | 9.IBPluginDependency 201 | 202 | 203 | YES 204 | UIApplication 205 | UIResponder 206 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 207 | RootViewController 208 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 209 | 210 | YES 211 | 212 | 213 | YES 214 | 215 | 216 | {{673, 376}, {320, 480}} 217 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 218 | CoreAnimationAppDelegate 219 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 220 | {{186, 376}, {320, 480}} 221 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 222 | 223 | 224 | 225 | YES 226 | 227 | 228 | YES 229 | 230 | 231 | 232 | 233 | YES 234 | 235 | 236 | YES 237 | 238 | 239 | 240 | 16 241 | 242 | 243 | 244 | YES 245 | 246 | RootViewController 247 | UITableViewController 248 | 249 | IBProjectSource 250 | Classes/RootViewController.h 251 | 252 | 253 | 254 | UIWindow 255 | UIView 256 | 257 | IBUserSource 258 | 259 | 260 | 261 | 262 | CoreAnimationAppDelegate 263 | NSObject 264 | 265 | YES 266 | 267 | YES 268 | navigationController 269 | window 270 | 271 | 272 | YES 273 | UINavigationController 274 | UIWindow 275 | 276 | 277 | 278 | YES 279 | 280 | YES 281 | navigationController 282 | window 283 | 284 | 285 | YES 286 | 287 | navigationController 288 | UINavigationController 289 | 290 | 291 | window 292 | UIWindow 293 | 294 | 295 | 296 | 297 | IBProjectSource 298 | Classes/CoreAnimationAppDelegate.h 299 | 300 | 301 | 302 | 303 | YES 304 | 305 | NSObject 306 | 307 | IBFrameworkSource 308 | Foundation.framework/Headers/NSError.h 309 | 310 | 311 | 312 | NSObject 313 | 314 | IBFrameworkSource 315 | Foundation.framework/Headers/NSFileManager.h 316 | 317 | 318 | 319 | NSObject 320 | 321 | IBFrameworkSource 322 | Foundation.framework/Headers/NSKeyValueCoding.h 323 | 324 | 325 | 326 | NSObject 327 | 328 | IBFrameworkSource 329 | Foundation.framework/Headers/NSKeyValueObserving.h 330 | 331 | 332 | 333 | NSObject 334 | 335 | IBFrameworkSource 336 | Foundation.framework/Headers/NSKeyedArchiver.h 337 | 338 | 339 | 340 | NSObject 341 | 342 | IBFrameworkSource 343 | Foundation.framework/Headers/NSObject.h 344 | 345 | 346 | 347 | NSObject 348 | 349 | IBFrameworkSource 350 | Foundation.framework/Headers/NSRunLoop.h 351 | 352 | 353 | 354 | NSObject 355 | 356 | IBFrameworkSource 357 | Foundation.framework/Headers/NSThread.h 358 | 359 | 360 | 361 | NSObject 362 | 363 | IBFrameworkSource 364 | Foundation.framework/Headers/NSURL.h 365 | 366 | 367 | 368 | NSObject 369 | 370 | IBFrameworkSource 371 | Foundation.framework/Headers/NSURLConnection.h 372 | 373 | 374 | 375 | NSObject 376 | 377 | IBFrameworkSource 378 | UIKit.framework/Headers/UIAccessibility.h 379 | 380 | 381 | 382 | NSObject 383 | 384 | IBFrameworkSource 385 | UIKit.framework/Headers/UINibLoading.h 386 | 387 | 388 | 389 | NSObject 390 | 391 | IBFrameworkSource 392 | UIKit.framework/Headers/UIResponder.h 393 | 394 | 395 | 396 | UIApplication 397 | UIResponder 398 | 399 | IBFrameworkSource 400 | UIKit.framework/Headers/UIApplication.h 401 | 402 | 403 | 404 | UIBarButtonItem 405 | UIBarItem 406 | 407 | IBFrameworkSource 408 | UIKit.framework/Headers/UIBarButtonItem.h 409 | 410 | 411 | 412 | UIBarItem 413 | NSObject 414 | 415 | IBFrameworkSource 416 | UIKit.framework/Headers/UIBarItem.h 417 | 418 | 419 | 420 | UINavigationBar 421 | UIView 422 | 423 | IBFrameworkSource 424 | UIKit.framework/Headers/UINavigationBar.h 425 | 426 | 427 | 428 | UINavigationController 429 | UIViewController 430 | 431 | IBFrameworkSource 432 | UIKit.framework/Headers/UINavigationController.h 433 | 434 | 435 | 436 | UINavigationItem 437 | NSObject 438 | 439 | 440 | 441 | UIResponder 442 | NSObject 443 | 444 | 445 | 446 | UISearchBar 447 | UIView 448 | 449 | IBFrameworkSource 450 | UIKit.framework/Headers/UISearchBar.h 451 | 452 | 453 | 454 | UISearchDisplayController 455 | NSObject 456 | 457 | IBFrameworkSource 458 | UIKit.framework/Headers/UISearchDisplayController.h 459 | 460 | 461 | 462 | UITableViewController 463 | UIViewController 464 | 465 | IBFrameworkSource 466 | UIKit.framework/Headers/UITableViewController.h 467 | 468 | 469 | 470 | UIView 471 | 472 | IBFrameworkSource 473 | UIKit.framework/Headers/UITextField.h 474 | 475 | 476 | 477 | UIView 478 | UIResponder 479 | 480 | IBFrameworkSource 481 | UIKit.framework/Headers/UIView.h 482 | 483 | 484 | 485 | UIViewController 486 | 487 | 488 | 489 | UIViewController 490 | 491 | IBFrameworkSource 492 | UIKit.framework/Headers/UIPopoverController.h 493 | 494 | 495 | 496 | UIViewController 497 | 498 | IBFrameworkSource 499 | UIKit.framework/Headers/UISplitViewController.h 500 | 501 | 502 | 503 | UIViewController 504 | 505 | IBFrameworkSource 506 | UIKit.framework/Headers/UITabBarController.h 507 | 508 | 509 | 510 | UIViewController 511 | UIResponder 512 | 513 | IBFrameworkSource 514 | UIKit.framework/Headers/UIViewController.h 515 | 516 | 517 | 518 | UIWindow 519 | UIView 520 | 521 | IBFrameworkSource 522 | UIKit.framework/Headers/UIWindow.h 523 | 524 | 525 | 526 | 527 | 0 528 | IBCocoaTouchFramework 529 | 530 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 531 | 532 | 533 | 534 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 535 | 536 | 537 | YES 538 | CoreAnimation.xcodeproj 539 | 3 540 | 112 541 | 542 | 543 | -------------------------------------------------------------------------------- /Resources/XIBs/RootViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J567 6 | 823 7 | 1038.35 8 | 462.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 132 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | 42 | 274 43 | {320, 247} 44 | 45 | 46 | 3 47 | MQA 48 | 49 | NO 50 | YES 51 | NO 52 | 53 | 3 54 | 55 | IBCocoaTouchFramework 56 | NO 57 | 1 58 | 0 59 | YES 60 | 44 61 | 22 62 | 22 63 | 64 | 65 | 66 | 67 | YES 68 | 69 | 70 | view 71 | 72 | 73 | 74 | 3 75 | 76 | 77 | 78 | dataSource 79 | 80 | 81 | 82 | 4 83 | 84 | 85 | 86 | delegate 87 | 88 | 89 | 90 | 5 91 | 92 | 93 | 94 | 95 | YES 96 | 97 | 0 98 | 99 | 100 | 101 | 102 | 103 | -1 104 | 105 | 106 | File's Owner 107 | 108 | 109 | -2 110 | 111 | 112 | 113 | 114 | 2 115 | 116 | 117 | 118 | 119 | 120 | 121 | YES 122 | 123 | YES 124 | -1.CustomClassName 125 | -2.CustomClassName 126 | 2.IBEditorWindowLastContentRect 127 | 2.IBPluginDependency 128 | 129 | 130 | YES 131 | RootViewController 132 | UIResponder 133 | {{144, 609}, {320, 247}} 134 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 135 | 136 | 137 | 138 | YES 139 | 140 | 141 | YES 142 | 143 | 144 | 145 | 146 | YES 147 | 148 | 149 | YES 150 | 151 | 152 | 153 | 5 154 | 155 | 156 | 157 | YES 158 | 159 | RootViewController 160 | UITableViewController 161 | 162 | IBProjectSource 163 | Classes/RootViewController.h 164 | 165 | 166 | 167 | 168 | YES 169 | 170 | NSObject 171 | 172 | IBFrameworkSource 173 | Foundation.framework/Headers/NSError.h 174 | 175 | 176 | 177 | NSObject 178 | 179 | IBFrameworkSource 180 | Foundation.framework/Headers/NSFileManager.h 181 | 182 | 183 | 184 | NSObject 185 | 186 | IBFrameworkSource 187 | Foundation.framework/Headers/NSKeyValueCoding.h 188 | 189 | 190 | 191 | NSObject 192 | 193 | IBFrameworkSource 194 | Foundation.framework/Headers/NSKeyValueObserving.h 195 | 196 | 197 | 198 | NSObject 199 | 200 | IBFrameworkSource 201 | Foundation.framework/Headers/NSKeyedArchiver.h 202 | 203 | 204 | 205 | NSObject 206 | 207 | IBFrameworkSource 208 | Foundation.framework/Headers/NSObject.h 209 | 210 | 211 | 212 | NSObject 213 | 214 | IBFrameworkSource 215 | Foundation.framework/Headers/NSRunLoop.h 216 | 217 | 218 | 219 | NSObject 220 | 221 | IBFrameworkSource 222 | Foundation.framework/Headers/NSThread.h 223 | 224 | 225 | 226 | NSObject 227 | 228 | IBFrameworkSource 229 | Foundation.framework/Headers/NSURL.h 230 | 231 | 232 | 233 | NSObject 234 | 235 | IBFrameworkSource 236 | Foundation.framework/Headers/NSURLConnection.h 237 | 238 | 239 | 240 | NSObject 241 | 242 | IBFrameworkSource 243 | UIKit.framework/Headers/UIAccessibility.h 244 | 245 | 246 | 247 | NSObject 248 | 249 | IBFrameworkSource 250 | UIKit.framework/Headers/UINibLoading.h 251 | 252 | 253 | 254 | NSObject 255 | 256 | IBFrameworkSource 257 | UIKit.framework/Headers/UIResponder.h 258 | 259 | 260 | 261 | UIResponder 262 | NSObject 263 | 264 | 265 | 266 | UIScrollView 267 | UIView 268 | 269 | IBFrameworkSource 270 | UIKit.framework/Headers/UIScrollView.h 271 | 272 | 273 | 274 | UISearchBar 275 | UIView 276 | 277 | IBFrameworkSource 278 | UIKit.framework/Headers/UISearchBar.h 279 | 280 | 281 | 282 | UISearchDisplayController 283 | NSObject 284 | 285 | IBFrameworkSource 286 | UIKit.framework/Headers/UISearchDisplayController.h 287 | 288 | 289 | 290 | UITableView 291 | UIScrollView 292 | 293 | IBFrameworkSource 294 | UIKit.framework/Headers/UITableView.h 295 | 296 | 297 | 298 | UITableViewController 299 | UIViewController 300 | 301 | IBFrameworkSource 302 | UIKit.framework/Headers/UITableViewController.h 303 | 304 | 305 | 306 | UIView 307 | 308 | IBFrameworkSource 309 | UIKit.framework/Headers/UIPrintFormatter.h 310 | 311 | 312 | 313 | UIView 314 | 315 | IBFrameworkSource 316 | UIKit.framework/Headers/UITextField.h 317 | 318 | 319 | 320 | UIView 321 | UIResponder 322 | 323 | IBFrameworkSource 324 | UIKit.framework/Headers/UIView.h 325 | 326 | 327 | 328 | UIViewController 329 | 330 | IBFrameworkSource 331 | UIKit.framework/Headers/UINavigationController.h 332 | 333 | 334 | 335 | UIViewController 336 | 337 | IBFrameworkSource 338 | UIKit.framework/Headers/UIPopoverController.h 339 | 340 | 341 | 342 | UIViewController 343 | 344 | IBFrameworkSource 345 | UIKit.framework/Headers/UISplitViewController.h 346 | 347 | 348 | 349 | UIViewController 350 | 351 | IBFrameworkSource 352 | UIKit.framework/Headers/UITabBarController.h 353 | 354 | 355 | 356 | UIViewController 357 | UIResponder 358 | 359 | IBFrameworkSource 360 | UIKit.framework/Headers/UIViewController.h 361 | 362 | 363 | 364 | 365 | 0 366 | IBCocoaTouchFramework 367 | 368 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 369 | 370 | 371 | 372 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 373 | 374 | 375 | YES 376 | CoreAnimation.xcodeproj 377 | 3 378 | 132 379 | 380 | 381 | -------------------------------------------------------------------------------- /main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CoreAnimation 4 | // 5 | // Created by Bob McCune on 3/3/11. 6 | // Copyright 2011 McCune Object Solutions, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) { 12 | 13 | @autoreleasepool { 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | return retVal; 16 | } 17 | } 18 | --------------------------------------------------------------------------------