I want to crop the image after using camera or select from photoLibrary.
For now, I can only crop the square image and I have no idea how to crop a 4*3 image.
Here is my part of code
let imagePicker : UIImagePickerController = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = .PhotoLibrary
imagePicker.allowsEditing = true
I did not know that links are not permitted as answer. Here I will try to answer the question.
Aim: Crop image with a predefined ratio. Approach:
Now run the application see if we can view only the image in an 4:3 ratio scrollview.
For the save option just map the coordinates of the scrollview and get the image from the imageview (here we need to use the zoom scale)
Code: