0

I want to rotate a UILabel in semicircle.

So what I am planning to do is use some timing function like CaMediaTimingFunction.

I want to use getControlPointAtIndex method of CaMediaTiming Function so that I can get a set of points to rotate the UILabel. The points which I will get will help me in forming the frame for UILabel.

Does anybody have good idea other than this.

I want to rotate the Label in a semicircle very smoothly.

rkb
  • 10,933
  • 22
  • 76
  • 103

2 Answers2

1

If all you want to do is rotate the label in an animated fashion, you should just be able to set the transform property of the UILabel within an animation block, like the following:

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:5.0f];

label.transform = CGAffineTransformMakeRotation(90.0f * M_PI / 180.0f);

[UIView commitAnimations];

This will rotate your label by 90 degrees over a duration of 5 seconds.

If you wish to control the clockwise / counterclockwise direction of the rotation, you can refer to this answer, which shows how to use lower-level Core Animation keyframe animations to do this.

Community
  • 1
  • 1
Brad Larson
  • 170,088
  • 45
  • 397
  • 571
  • This rotates the label, I want to rotate the location of label in semicircle. – rkb Aug 10 '09 at 15:02
  • OK. Your question wasn't very clear. To move the label along a curve, you can follow the directions I provide here: http://stackoverflow.com/questions/1142727/how-can-i-animate-the-movement-of-a-view-or-image-along-a-curved-path/1143095#1143095 – Brad Larson Aug 10 '09 at 15:33
0

If you're making a game, you might want to take a look at cocos2d - it has some simple rotation & timer actions that are pretty easy to use.

http://code.google.com/p/cocos2d-iphone/

John
  • 1,549
  • 1
  • 13
  • 15
  • No I am not making any game, its a simple Data application, where I want to give user the flexibility to arrange the data. – rkb Aug 07 '09 at 23:15