I'm trying to change the image scale in a UIImageView, I want it to be smaller and keep its ratio.
I tried:
cameraPhoto.image?.scale = CGFloat(0.5)
but it doesn't work. I get:
Cannot assign to property: 'scale' is a get-only property
I want this:
instead of this:
How can I reduce the camera picture size (like on the example above)?




I think you need to create UIImageView with size of your image and place it on UIScrollView (and disable scroll). Then you can change scale of scroll view. https://www.brightec.co.uk/blog/creating-a-zoomable-image-view-in-swift