1

Possible Duplicate:
How do you create a wiggle animation similar to iphone deletion animation

Actually this is an answer ! i made tutorial for people who want create wiggle effect with UIImageView

The Wiggle Effect Code :

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.14];
[UIView setAnimationRepeatAutoreverses:YES];
[UIView setAnimationRepeatCount:10000];


myImage.transform = CGAffineTransformMakeRotation(69);
myImage.transform = CGAffineTransformMakeRotation(-69);

[UIView commitAnimations];

to stop the animation you can use this code :

myImage.transform = CGAffineTransformMakeRotation(0);

[myImage.layer removeAllAnimations]; 

//#import <QuartzCore/QuartzCore.h> to remove a compiler warning ;)

hope you enjoy it .

Community
  • 1
  • 1
Mc.Lover
  • 4,813
  • 9
  • 46
  • 80
  • 3
    Yeah nice but people who are looking for this have already some answer like here : http://stackoverflow.com/questions/3703922/how-do-you-create-a-wiggle-animation-similar-to-iphone-deletion-animation/3704540#3704540 (and some others topics). Maybe you could buzz your youtube video somewhere else. or give the link in appropriate questions. – Vinzius Oct 02 '10 at 09:54
  • By the way, as you edited your topic. You should know that CGAffineTransformMakeRotation take radians and not degrees ( http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Reference/CGAffineTransform/Reference/reference.html ). (you wrote "myImage.transform = CGAffineTransformMakeRotation(69);", I think you wanted to say 69*M_PI/180.0) – Vinzius Oct 02 '10 at 10:24
  • OK i removed the youtube link ;)and thank you for advise – Mc.Lover Oct 02 '10 at 11:00
  • 1
    You should probably post this as an answer to the linked question. – Bill the Lizard Oct 02 '10 at 21:12

0 Answers0