dmytro-anokhin / url-image

AsyncImage before iOS 15. Lightweight, pure SwiftUI Image view, that displays an image downloaded from URL, with auxiliary views and local cache.
MIT License
1.1k stars 96 forks source link

3.0 Identifier #148

Closed jessegrosjean closed 3 years ago

jessegrosjean commented 3 years ago

In update notes it says "Custom identifier can still be passed as an argument of URLImage", but the only constructor where I see that used is make private... is that an over-site?

jessegrosjean commented 3 years ago

My use case is that I have the same imageURL but in different parts of my UI I want to view it at different sizes. I'm using

.environment(\.urlImageOptions, URLImageOptions(
  maxPixelSize: CGSize(width: size, height: size)
))

But it seems that without a custom identifier get the cached version of the first loaded size always.

dmytro-anokhin commented 3 years ago

Hey,

thanks for reporting issue with identifier, it indeed must be public. Fix is in 3.0.1.

For you use case, you can configure different in memory store for different parts of the app. File store saves original image; in memory store - decoded up to the size you provide.