Skip to content

Instantly share code, notes, and snippets.

@ldandersen
Created November 25, 2009 20:03
Show Gist options
  • Save ldandersen/242992 to your computer and use it in GitHub Desktop.
Save ldandersen/242992 to your computer and use it in GitHub Desktop.
CABasicAnimation *positionAnimation = [CABasicAnimation animationWithKeyPath:@"position.x"];
positionAnimation.toValue = [NSNumber numberWithFloat: self.backgroundImageView.layer.position.x - 50.0];
CABasicAnimation *widthAnimation = [CABasicAnimation animationWithKeyPath:@"bounds.size.width"];
widthAnimation.toValue = [NSNumber numberWithFloat: self.backgroundImageView.bounds.size.width + 50.0];
CAAnimationGroup *resizeAnimationGroup = [CAAnimationGroup animation];
resizeAnimationGroup.duration = 0.5;
resizeAnimationGroup.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
resizeAnimationGroup.animations = [NSArray arrayWithObjects:positionAnimation, widthAnimation, nil];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment