SvenTiigi / WhatsNewKit

Showcase your awesome new app features 📱
https://sventiigi.github.io/WhatsNewKit/
MIT License
3.92k stars 193 forks source link

Display a UIImage #72

Closed coldfingersnz closed 1 year ago

coldfingersnz commented 1 year ago

Is your feature request related to a problem?

Hi, No bugs for me, your kit works well in my apps.

I was wondering if it was possible to use a UIImage instead of a system icon for a WhatsNew.Feature.

What solution would you like?

Use a UIImage instead of system icon

What alternatives have you considered?

I'm pretty new to this so I am a little stuck.

I was thinking it would be something like:

Instead of: WhatsNew.Feature( image: .init(systemName: "ladybug"), title: "Cleaned up some Bugs", subtitle: "We have sorted out some minor bugs and UI updates. " ),

my feature could be: WhatsNew.Feature( image: .init(UIImage: "myImage"), title: "Cleaned up some Bugs", subtitle: "We have sorted out some minor bugs and UI updates. " ),

I would be grateful for any help with pointing me in the right direction.

Any additional context?

No response

SvenTiigi commented 1 year ago

Hi @coldfingersnz,

You can simply use the WhatsNew.Feature.Image.init(image:) initializer and initialize a SwiftUI.Image with the appropriate UIImage initializer.

let image = WhatsNew.Feature.Image(
    image: SwiftUI.Image(
        uiImage: UIImage()
    )
)
coldfingersnz commented 1 year ago

Fantastic, thanks for the quick response, really appreciate it. Great Plugin!!