SDWebImageDownloader returns nil instead of SDWebImageOperation object. Some code below.
class PictureProvider: UIActivityItemProvider {
private var originalLoadingOperation: SDWebImageOperation?
fileprivate func loadOriginalImage(with link: String) {
let imageDownloader = SDWebImageDownloader.shared()
originalLoadingOperation = imageDownloader!.downloadImage(with: URL(string: link),
options: .continueInBackground,
progress: nil,
completed: { (image, data, error, finished) in
if image != nil
{
SDImageCache.shared().store(image, forKey: link)
}
})
}
}
originalLoadingOperation is always 'nil'.