Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL for cached image #2154

Closed
Patresko opened this issue Oct 20, 2023 · 1 comment
Closed

URL for cached image #2154

Patresko opened this issue Oct 20, 2023 · 1 comment

Comments

@Patresko
Copy link

How do I get url of cached image if exist in cache?

I would like to show image in .quickLookPreview.

@onevcat
Copy link
Owner

onevcat commented Oct 27, 2023

If you already knows the URL and didn't use a customized cache key or any image processor (ImageProcessor), then you can just use the methods in ImageCache to find out if an image is cached:

let cached = ImageCache.default.isCached(forKey: url.absoluteString)

@onevcat onevcat closed this as completed Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants