-
-
Save codeswimmer/3362149 to your computer and use it in GitHub Desktop.
View shake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position"]; | |
[animation setDuration:0.08]; | |
[animation setRepeatCount:3]; | |
[animation setAutoreverses:YES]; | |
[animation setFromValue:[NSValue valueWithCGPoint: | |
CGPointMake([formContainer center].x - 20.0f, [formContainer center].y)]]; | |
animation setToValue:[NSValue valueWithCGPoint: | |
CGPointMake([formContainer center].x + 20.0f, [formContainer center].y)]]; | |
[[formContainer layer] addAnimation:animation forKey:@"position"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment