The image.size
attribute of UIImageView
gives the size of the original UIImage
. I would like to find out the size of the autoscaled image when it is put in the UIImageView
(typically smaller than the original).
For example, I have the image set to Aspect Fit
. Now I want to know its new height and width on the screen so I can draw accurately on the new scaled image.
Is there any way to do this without figuring it out myself based on the UIImageView size & UIImage original size (basically reverse engineering its scaling)?
Best Answer
Objective-C:
Swift 4: