How to programmatically rotate the view by 180 degrees on iOS?

后端 未结 7 1164
面向向阳花
面向向阳花 2021-02-04 10:15

How to programmatically rotate the view by 180 degrees in my iPhone App?

7条回答
  •  情歌与酒
    2021-02-04 11:04

    In Swift 3 :

    let rotationDegrees =  180.0
    let rotationAngle = CGFloat(rotationDegrees * M_PI / 180.0)
    view.transform = CGAffineTransform(rotationAngle: rotationAngle)
    

提交回复
热议问题