I have an UIimageview but when the picture is taken, the image does not follow the size of UIimageview like this

I have an UIimageview but when the picture is taken, the image does not follow the size of UIimageview like this

You should set the clipToBounds property of the UIImageView to true. This will solve your problem. Learn more at https://developer.apple.com/documentation/uikit/uiview/1622415-clipstobounds