Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Animation like Radar Objective C

How i can do a UIView animation like a radar? I already have a UIView with the circles created with drawrect, but how i can create a line, doing a clock animation?

Like the image below : enter image description here

like image 896
darkman Avatar asked Mar 18 '13 17:03

darkman


1 Answers

If you are already having all these images then you only require one radar line animation.

You can rotate radar line using this code:

- (void) startAnimation {

CABasicAnimation *radarHand;

radarHand = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];

radarHand.fromValue = [NSNumber numberWithFloat:fromAngle+M_PI];

radarHand.byValue = [NSNumber numberWithFloat:((360*M_PI)/180)];

radarHand.duration = 60.0f;

radarHand.repeatCount = HUGE_VALF;

}

(Guess radar line - semi transparent image is also there with you.)

Hope this will help you.

like image 72
Mrunal Avatar answered Sep 19 '22 14:09

Mrunal