In this blog, we are going to implement the functionality of “Cropping Image”.
when we use an image picker we only take selected images we couldn’t crop the image according to our need and we couldn’t rotate our image. To overcome this problem we use the crop image functionality.
For this functionality, we need to download a pod file
1
pod'QCropper'
How to install pod file – we need to follow some steps
open your xCode project in terminal
write pod init -> Enter
writre pod install -> Enter
wrtie pod file name like below image
5. write pod install -> Enter
Now open your .xcworkspace project into your Xcode
Now open viewController Class and write some code for upload images from the gallery.
you need to call the “import QCropper” module in the top
1
2
3
4
5
let picker=UIImagePickerController()
picker.sourceType=.photoLibrary
picker.allowsEditing=false
picker.delegate=self
self.present(picker,animated:true,completion:nil)
After that, you need to call the image Picker method
Be the first to comment.