How to rotate image in Swift?

后端 未结 13 1226
萌比男神i
萌比男神i 2020-11-30 03:55

I am unable to rotate the image by 90 degrees in swift. I have written below code but there is an error and doesn\'t compile

  func imageRotatedByDegrees(old         


        
13条回答
  •  既然无缘
    2020-11-30 04:10

    ImageView?.transform = transform.rotated(by: (CGFloat(Double.pi / 2)))
    

    Swift 4.2

    Rotation - right. Works fine.

提交回复
热议问题