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

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

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

6条回答
  •  无人及你
    2021-01-30 13:31

    In swift 2 and Xcode 7 :

    let RdnVal = CGFloat(atan2f(Float(NamVyu.transform.b), Float(NamVyu.transform.a)))
    let DgrVal = RdnVal * CGFloat(180 / M_PI)
    

提交回复
热议问题