-
-
Save dabing1022/0ad79b6a8736e8d849b5 to your computer and use it in GitHub Desktop.
Revisions
-
nielsbot revised this gist
Apr 4, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,5 +9,5 @@ anim.repeatCount = 2.0f ; anim.duration = 0.07f ; [ viewToShake.layer addAnimation:anim forKey:nil ] ; -
nielsbot created this gist
Feb 21, 2012 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ // this code will cause a UIView to shake--good for "login error" CAKeyframeAnimation * anim = [ CAKeyframeAnimation animationWithKeyPath:@"transform" ] ; anim.values = [ NSArray arrayWithObjects: [ NSValue valueWithCATransform3D:CATransform3DMakeTranslation(-5.0f, 0.0f, 0.0f) ], [ NSValue valueWithCATransform3D:CATransform3DMakeTranslation(5.0f, 0.0f, 0.0f) ], nil ] ; anim.autoreverses = YES ; anim.repeatCount = 2.0f ; anim.duration = 0.07f ; [ viewToShake.layer addAnimation:anim forKey:@"nil" ] ;