DKImagePickerController
DKImagePickerController copied to clipboard
Fetch Original Image return nil
I want to get the images I chose , so I wrote this code
func showImagePicker() {
let pickerController = DKImagePickerController()
// self.previewView?.isHidden = false
pickerController.autoCloseOnSingleSelect = true
pickerController.assetType = .allPhotos
pickerController.defaultAssetGroup = .smartAlbumUserLibrary
pickerController.didSelectAssets = { (assets: [DKAsset]) in
if assets.count>0
{
for i in 0 ... assets.count-1 {
assets[i].fetchOriginalImage { (img, info) in
self.abc.append(img!)
}
}
}
self.image.image = self.abc[0]
self.previewView?.reloadData()
}
self.present(pickerController, animated: true) {}
}
As a result of this code, I get the photos I chose in DKAsset format But when I apply Fetch Original Image , I don't get a result and the function does not enter the complition
how did you solve this issue???
Unfortunately, I had to change the library to TLPhotoPicker
Use this func :fetchImage asset.fetchImage(with: self.view.bounds.size, completeBlock: { image, info in myImageView.image = image }