-(void)shakeImageInX
{
CAKeyframeAnimation *anim = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.y"];
anim.values = [NSArray arrayWithObjects:[NSNumber numberWithFloat:-15],
[NSNumber numberWithFloat:15],
nil];
anim.duration = 0.2;
anim.autoreverses = YES;
anim.repeatCount = 0;
anim.additive = YES;
anim.fillMode=kCAFillModeForwards;
[imageView.layer addAnimation:anim forKey:@"wiggleTranslationY"];
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment