Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get perfect X , Y position of rotating UIView in ios

I am using CABasicanimation for rotate an UIView. I am using this code,

    CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
    NSNumber *currentAngle = [CircleView.layer.presentationLayer valueForKeyPath:@"transform.rotation"];
    rotationAnimation.fromValue = currentAngle;
    rotationAnimation.toValue = @(50*M_PI);
    rotationAnimation.duration = 50.0f;             // this might be too fast
    rotationAnimation.repeatCount = HUGE_VALF;     // HUGE_VALF is defined in math.h so import it
    [CircleView.layer addAnimation:rotationAnimation forKey:@"rotationAnimationleft"];

in this i want perfect X,Y position while "UIView" is rotating. If anyone know please help me.

Thank you in advance.enter image description here

like image 705
Hardik Vyas Avatar asked Jan 13 '16 10:01

Hardik Vyas


1 Answers

I Got A Answer Of This Question Please Go To This Link For Answer

Go to This Link For Answer

like image 109
Hardik Vyas Avatar answered Oct 20 '22 22:10

Hardik Vyas