I usually use the following code to set rounded corners.
imageView.layer.cornerRadius = 10
It works if imageView is set to Fill Aspect.
But when the imageView parameter is set to Aspect Fit mode, and the ratio between the image and the image is different. The effect of rounded corners cannot tell.

The background color is set to green to show rounded corners.
Is there a way to set the “real part of the image” to rounded corners.
Thank you in advance for your answers.
ios objective-c swift rounded-corners cornerradius
cowbjt
source share