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

Real world example of album.add #17

Open
daviddahl opened this issue Jan 15, 2024 · 0 comments
Open

Real world example of album.add #17

daviddahl opened this issue Jan 15, 2024 · 0 comments

Comments

@daviddahl
Copy link

I find some of the APIs in Media very difficult to understand. A real-world example of album.add() would be very helpful.

I am downloading random images, png, Jpeg or webp and would like to save in an album I have created. How does one construct a Photo object conforming to MediaProtocol?

I have a UIImage or cGImage and cannot figure out how to create the Photo...

// image was downloaded via KingFisher
let album = try Album.with(identifier: DEFAULT_ALBUM_NAME)

album?.add() <-- I have a UIImage or CGImage instance, how do I convert it to a `Photo`?
           
image
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

1 participant