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
let angle = CGFloat(M_PI_2) let tr = CGAffineTransform.identity.rotated(by: angle) ImageView.transform = tr