Tool to convert SVG to SwiftUI's Shape structure. This approach is much more memory efficient than introducing a SVG library for rendering.
This tool is oriented towards use cases, where creating an SF symbol is not viable, for example for complex animations. This tool also works great if you're under time pressure or just lazy, and need to have your icon in the app as fast as possible. For general purpose icons it might be better to use this guide to create an SF Symbol instead.
⭐️ Star this repository! ⭐️
The tool is available online, just follow this link.
git clone https://github.com/bring-shrubbery/SVG-to-SwiftUI
cd SVG-to-SwiftUI
pnpm install
pnpm dev
To demonstrate this tool I created a thicc plus sign with rounded corners (created it in Sketch, so shapes from Sketch should work fine with this tool).
It's saved as content/demo-plus.svg
file in this repository. You can see below how it looks like in the browser, and how it looks like after converting into SwiftUI Shape.
- Feel free to open an issue for the SVG code that did not work - provide the SVG code of course!
- Pull requests are very welcome! Introducing support for more SVG element types would be the best contribution at this point.
Please consider following this project's author, Antoni Silvestrovič on Github or Bluesky, or by starring the project to show your ❤️ and support.