I've tried to load icloud image using phasset with options requestOptions.isSynchronous = false requestOptions.isNetworkAccessAllowed = true I get CloudPhotoLibraryErrorDomain Code=1005 error I don't understand where I make mistake, I have used SDWebImagePhotosPlugin methods as well as Photos methods like requestImageDataAndOrientation and requestImageData, still I get the image as nil and the above error this is my code:
imageManager.requestImageDataAndOrientation(for: deviceImage, options: phImageRequestOptions()) { data,deliveryMode, orentation, _ in if data != nil { completion(data) } else { SDImageLoadersManager.shared.loaders = [SDWebImageDownloader.shared, SDImagePhotosLoader.shared] SDWebImageManager.defaultImageLoader = SDImageLoadersManager.shared
let photosURL = NSURL.sd_URL(with: deviceImage) SDImagePhotosLoader.shared.requestImage(with: photosURL as URL?, options: [.highPriority,.retryFailed,.refreshCached], context: [.customManager: self.manager], progress: nil) { image, data,error, success in if image != nil { completion(image?.pngData()) } else { completion(nil) } } }