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

前端 未结 6 1354
傲寒
傲寒 2021-01-30 12:40

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

6条回答
  •  花落未央
    2021-01-30 13:28

    You can do it this way...

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

提交回复
热议问题