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

Save URLImage to Photos library ? #158

Closed h-elbeheiry closed 3 years ago

h-elbeheiry commented 3 years ago

HI, I'm trying to be able to allow the user to save URL image to his device for example on a button press, can't seem to be able to figure out how with SwiftUI.

dmytro-anokhin commented 3 years ago

Hey,

this is a bit beyond the package scope, but you can fetch an image and store it using PhotoKit. Use this gist URLImageService+FetchImage.swift and Requesting Changes to the Photo Library documentation for reference. From there it should be straightforward to implement.

Note: URLImageFileStore allows you to access image file location using getImageLocation method.

Hope this helps.