Created
June 11, 2014 04:16
-
-
Save minsOne/347ded055e1044b1aca4 to your computer and use it in GitHub Desktop.
This file contains 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 *shake = [CABasicAnimation animationWithKeyPath:@"position"]; | |
[shake setDuration:0.1]; | |
[shake setRepeatCount:2]; | |
[shake setAutoreverses:YES]; | |
[shake setFromValue:[NSValue valueWithCGPoint: | |
CGPointMake(view.center.x - 5,view.center.y)]]; | |
[shake setToValue:[NSValue valueWithCGPoint: | |
CGPointMake(view.center.x + 5, view.center.y)]]; | |
[view.layer addAnimation:shake forKey:@"position"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment