I am rotating a square image View whose width is 160 but after rotation width become 190 same as height.
Rotating it by this function
func transformUsingRecognizer(_ recognizer: UIGestureRecognizer, transform: CGAffineTransform) -> CGAffineTransform {
if let rotateRecognizer = recognizer as? UIRotationGestureRecognizer {
return transform.rotated(by: rotateRecognizer.rotation)
}
return transform
}
tried these two codes to get correct width
imgDraggingImage.bounds.size.width
imgDraggingImage.frame.height
but no success.
Image before rotation width 160
Image after rotation, no change in width but now returning width 190
Seems width value depends on rotation as on any different angle it returns different width value. But I need correct value which in this case is 160. please help