Skip to content

Instantly share code, notes, and snippets.

@madebyjeffrey
Created November 16, 2010 20:31
Show Gist options
  • Save madebyjeffrey/702452 to your computer and use it in GitHub Desktop.
Save madebyjeffrey/702452 to your computer and use it in GitHub Desktop.
Adapting an example, doesn't work fully yet
- (void) present
{
CABasicAnimation *a;
a = [CABasicAnimation animationWithKeyPath: @"transform.scale"];
a.duration = 6;
a.repeatCount = 0;
a.autoreverses = NO;
a.fromValue = [NSNumber numberWithFloat: 0];
a.toValue = [NSNumber numberWithFloat: 1.2];
a.removedOnCompletion = YES;
a.delegate = self;
[self addAnimation: a forKey: @"firstScale"];
NSLog(@"Intro scale");
}
- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
{
if (theAnimation == [self animationForKey: @"firstScale"])
{
NSLog(@"End of first scale");
CABasicAnimation *a;
a = [CABasicAnimation animationWithKeyPath: @"transform.scale"];
a.duration = 2;
a.repeatCount = 0;
a.autoreverses = NO;
a.fromValue = [NSNumber numberWithFloat: 1.2];
a.toValue = [NSNumber numberWithFloat: 1.0];
a.removedOnCompletion = YES;
a.delegate = self;
[self addAnimation: a forKey: @"endScale"];
NSLog(@"Scaling finished");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment