Skip to content

Real world example of album.add  #17

@daviddahl

Description

@daviddahl

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions