Is there any simple way to achieve a 1:1 aspect ratio and scale to the original image inside an ImageView ?
I don't want only to keep the Image aspect ratio, I want it to be exactly the same size as the underlying image (1:1 scale also to original)... not smaller, not bigger... so it will be 1:1 on screen in therms of pixels or UIKit points or w/e with the original (scaling 1).
If you only set aspect ratio, the image might scale up or down, whilst keeping aspect ratio. I want to prevent this behaviour and to tell it not to scale.
How can I set the scale to be 1 as a constraint ? Is there any way in doing this, without any hardcoding on width / height constraints to match the size of the original image ?
Basically I want to tell the autolayout... here is the image, don't touch it, never scale it no matter what, let it be exactly as the original (scaling 1).
UPDATE:
The only way I could achieve this is by setting the hugging / compression priorities to higher than other items in the layout. Only setting aspect ratio constraint doesn't do it... I think there is no other way to ensure this behaviour without touching compression / hugging priorities.