Skip to content

Conversation

@CalebKierum
Copy link

I do believe this applies to images in general within a swift package, however I am nearly certain this is needed for SVGs.


SVGs are “supported” in iOS apps via a process step. If you are inside of a swift package and want to use a SVG with ConfettiUI you are unable to. This is because Image(String) within a swift package will not be able to find the image as it is processed by the package. To get this to work you need to add resources: [Resource.process("Media.xcassets")] to your package. This has the SVGs “processed” when the package is built (into what I do not know) and makes them accessible viaImage("image", bundle: packageBundle).

All this change is doing is adding an optional bundle argument to the image type of ConfettiType this way when you are in a package and wanting to use custom ConfettiType you can just specify the bundle!

Attached is a quick test of this. There are two packages in the zip. One has this change, the other demonstrates having a svg for confetti and using this change to use it with ConfettiUI.

Screenshot 2025-08-16 at 4 08 44 PM

Demo Packages.zip

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

Successfully merging this pull request may close these issues.

1 participant