Animation as a Radar Objective C

How can I make a UIView animation as a radar? I already have a UIView with circles created using drawrect, but how can I create a string by animating the clock?

As below: enter image description here

+5
source share
2 answers

If you already have all of these images, you will need only one radar animation.

You can rotate the 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 the radar line - a translucent image is also with you.)

Hope this helps you.

+6
source

You can create UIViewwith the size of this circle and with the center in the center of the circle, draw a line (which starts from the center of this view) and rotate this view.

0
source

All Articles