This repository was archived by the owner on Nov 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 258
This repository was archived by the owner on Nov 29, 2022. It is now read-only.
Photo picker in swift #134
Copy link
Copy link
Open
Description
Hi,
First of all
Thank you so much for making this awesome library :)
I have question, how to implement editor picker in swift since i always getting warning error
In my case, photo will cropping after photo selected from photo library or by camera.
here is my code
func takePictureFromLiblary(){
let imagePicker = UIImagePickerController()
imagePicker.allowsEditing = true
imagePicker.cropMode = DZNPhotoEditorViewControllerCropMode.Circular
imagePicker.delegate = self
if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.PhotoLibrary) {
imagePicker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary
} else if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.SavedPhotosAlbum) {
imagePicker.sourceType = UIImagePickerControllerSourceType.SavedPhotosAlbum
} else {
JLToast.makeText("Galery not available, please check your camera and try again", duration:JLToastDelay.ShortDelay).show()
}
imagePicker.finalizationBlock = { (picker: UIImagePickerController, info: NSDictionary) in
}
imagePicker.cancellationBlock = { (picker: UIImagePickerController) in
}
self.presentViewController(imagePicker, animated: true, completion: nil)
}
and here is warning error message
Cannot assign value of type '(UIImagePickerController, NSDictionary) -> ()' to type 'UIImagePickerControllerFinalizationBlock!'
Cannot assign value of type '(UIImagePickerController) -> ()' to type 'UIImagePickerControllerCancellationBlock!'
Any help would be appreciated :)
Thank you for advance
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels