Search code examples
ioscocoa-touchuiviewrotation

Get the current angle/rotation/radian for a UIView?


How do you get the current angle/rotation/radian a UIView has?


Solution

  • You can do it this way...

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