Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get UIView 's angle after CGAffineTransform?

Tags:

angle

i have been do more CGAffineTransform.

how to get current Uiview's angle?

i want to do something when angle==[M_PI/2 ~ M_PI]?

like image 266
sailor Avatar asked Dec 23 '10 10:12

sailor


People also ask

How do you rotate a view in Swift?

rorateview.swiftlet bitmap: CGContext = UIGraphicsGetCurrentContext()! //Move the origin to the middle of the image so we will rotate and scale around the center. let newImage: UIImage = UIGraphicsGetImageFromCurrentImageContext()!


1 Answers

CGFloat radians = atan2f(self.view.transform.b, self.view.transform.a); CGFloat degrees = radians * (180 / M_PI);

like image 162
Caroline Avatar answered Sep 20 '22 18:09

Caroline