Kingfisher icon indicating copy to clipboard operation
Kingfisher copied to clipboard

A data reader in `RetrieveImageResult`

Open onevcat opened this issue 3 years ago • 0 comments

As for #1409 it adds a data property to get the image data from result easier.

imageView.kf.setImage(with: url) { result in
  let data = try? result.get().data()
}

However, since the current image cache does not require a data to use, it requires a serialize of image to get the data, which might cause unnecessary performance cost when the images are loaded from cache (when loading from network, the downloaded data is contained in the result so everything is smooth). Changing this behavior would require a change to the public APIs and it has to be postponed to a major version release later.

onevcat avatar Sep 11 '22 07:09 onevcat