How to rotate image in Swift?

后端 未结 13 1283
萌比男神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:06

     let angle =  CGFloat(M_PI_2)
      let tr = CGAffineTransform.identity.rotated(by: angle)
      ImageView.transform = tr
    

提交回复
热议问题