
I would like to create a new UIImage by cropping the image inside a UIImageVie
I think you don't understand what you are doing. You can't "crop" a UIImageView - only UIImages. So your croppedImage method should be in a UIImage category and not a UIImageView category. The bounds rect you pass to the crop method must be in relation to the image size, not to the imageview bounds. It is irrelevant what the contentMode of the image view is - the cropping of the image will always work the same. First get the image from the image view. Then create a new cropped image from it and finally set the cropped image for the image view. This can be done in one line of code:
imageView.image = [imageView.image croppedImage:rect];
Since your contentMode is 'aspect fit' the new image will automatically stretch to fit in the view frame. You can also try to change the view frame based on the image.size to avoid pixelation effects.